Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guide: prerender.io Apache integration  #361

Open
1 task done
juliamrch opened this issue Aug 23, 2024 · 2 comments
Open
1 task done

Guide: prerender.io Apache integration  #361

juliamrch opened this issue Aug 23, 2024 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@juliamrch
Copy link
Collaborator

Checking for existing issue

  • I have checked for existing issues

Describe the content you'd like to see

Overview

A customer has raised questions about integrating prerender.io to a Clever Cloud application. Although Prerender provides detailed documentation on stack-based integrations, the ticket showed that little was provided about Clever Cloud Apache configuration in our doc (activated modules, TLS managed by Sozu).

Why we should document it

Integrating this kind of services at Apache level might be a more generalist approach, and documenting the process would allow us to:

  1. Document more exhaustively our Apache general configuration
  2. Get a baseline for more integrations of this kind in the future
@juliamrch juliamrch added the documentation Improvements or additions to documentation label Aug 23, 2024
@Kirbeerus
Copy link
Contributor

Kirbeerus commented Aug 27, 2024

I managed to make the prerender work using HTTP.
I am not sure if it is possible using HTTPS as ssl_module is not activated in the config and you need to modify the vhost to activate SSLProxyEngine

The only change i made was to use http://service.prerender.io
You can test that prerender work using google chrome and this guide. https://docs.prerender.io/docs/how-to-test-your-site-after-you-have-successfully-validated-your-prerender-integration

Here is the code in .htaccess that worked for me, you just need to add your token.


<IfModule mod_headers.c>
    RequestHeader set X-Prerender-Token "<YOUR_TOKEN>"
    RequestHeader set X-Prerender-Version "[email protected]"
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On

    <IfModule mod_proxy_http.c>
        RewriteCond %{HTTP_USER_AGENT} googlebot|bingbot|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp|redditbot|applebot|flipboard|tumblr|bitlybot|skypeuripreview|nuzzel|discordbot|google\ page\ speed|qwantify|bitrix\ link\ preview|xing-contenttabreceiver|google-inspectiontool|chrome-lighthouse|telegrambot [NC,OR]
        RewriteCond %{QUERY_STRING} _escaped_fragment_
        RewriteCond %{REQUEST_URI} ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff|\.svg))

        RewriteRule ^(index\.html|index\.php)?(.*) http://service.prerender.io/%{REQUEST_SCHEME}://%{HTTP_HOST}$2 [P,END]
    </IfModule>
</IfModule>

@cnivolle
Copy link
Member

@Kirbeerus can you draft a first PR about this please ?
Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: No status
Development

No branches or pull requests

3 participants