We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am having an issue where NGINX redirect to my prerendering server rather than serving the HTML from the same domain.
This is roughly what happens, I go to a valid URL and add escaped_fragment to test the pre-rendering
https://domain.com/to-prerender?_escaped_fragment_
It gets redirected to the following URL in the browser
https://prerender.mydomain.com/https://domain.com/to-prerender?_escaped_fragment_
Any idea why this is happening?
I am using a NGINX proxy pass
The text was updated successfully, but these errors were encountered:
This is how my NGINX config looks like
server { set $root /usr/share/nginx/html; resolver 8.8.8.8; set $prerender "prerender.mydomain.com"; listen 80; server_name *.mydomain.com; # all subdomains location / { root $root; try_files $uri @prerender; } location @prerender{ proxy_set_header X-Prerender-Token tMHIFXOFsxeqmbExUXo0; proxy_set_header Accept-Encoding "gzip"; gunzip on; root $root; # don't let rate limiting or server errors interrupt a request proxy_intercept_errors on; error_page 429 500 502 503 504 =200 /index.html; set $prerender 0; if ($uri ~ "^(([^.]|\.html?)+)$") { set $prerender 0; } if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator|redditbot|Applebot|WhatsApp|flipboard|tumblr|bitlybot") { set $prerender 1; } # don't prerender if the prerender user agent is retrieving the page if ($http_user_agent ~ "Prerender") { set $prerender 0; } if ($args ~ "_escaped_fragment_") { set $prerender 1; } if ($prerender = 1) { rewrite .* /https://$host$request_uri? break; proxy_pass http://$prerender$uri; break; } rewrite .* /index.html break; } }
Sorry, something went wrong.
No branches or pull requests
I am having an issue where NGINX redirect to my prerendering server rather than serving the HTML from the same domain.
This is roughly what happens, I go to a valid URL and add escaped_fragment to test the pre-rendering
https://domain.com/to-prerender?_escaped_fragment_
It gets redirected to the following URL in the browser
https://prerender.mydomain.com/https://domain.com/to-prerender?_escaped_fragment_
Any idea why this is happening?
I am using a NGINX proxy pass
The text was updated successfully, but these errors were encountered: