I developed an ajax based web application with hash bang urls.
I am trying to redirect requests from search engines to another server that generates HTML snapshots and sends a response. I am trying to achieve this in nginx with a location directive as follows:
location ~ ^(/?_escaped_fragment_=).*$ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 60s;
proxy_send_timeout 90s;
proxy_read_timeout 90s;
proxy_buffering off;
proxy_temp_file_write_size 64k;
proxy_pass http://x1.x2.x3.x4:8080;
proxy_redirect off;
}
But I can't get this to work. Can someone fix the regex that I use (or) provide me with an alternative solution to achieve this.
Thanks in advance.
source
share