Welcome! Log In Create A New Profile

Advanced

How do I redirect/handle requests from search engines via nginx using location regex

Raviteja Dodda
April 25, 2012 04:42AM
Hi,

I have developed an ajax-based web application with hash bang urls.

I am trying to redirect requests from search engines to another server
which generates HTML snapshots and send the response. I am trying to
achieve this in nginx with the location directive as mentioned below:

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 am not able to get this working. Can someone correct the regex I am
using (or) provide me an alternative solution to achieve this.

Thanks in advance,

Ravi
--
This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and
delete this e-mail from your system. E-mail transmission cannot be
guaranteed to be secure or error-free as information could be intercepted,
corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or omissions
in the contents of this message, which arise as a result of e-mail
transmission. If verification is required please request a hard-copy
version. Pipal Tech Ventures Private Limited (www.pipaltechventures.com)
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How do I redirect/handle requests from search engines via nginx using location regex

Raviteja Dodda April 25, 2012 04:42AM

Re: How do I redirect/handle requests from search engines via nginx using location regex

Francis Daly April 25, 2012 03:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 161
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready