Welcome! Log In Create A New Profile

Advanced

double slashes redirection

Benoit Vasseur
October 06, 2014 05:20AM
Hi everybody,

I am in trouble with my nginx configuration.

my version of nginx is 1.1.19

My goal is to redirect http://example.com//site to http://example/site

My app is in Rails and I want to handle this redirect with Rack.

However I am not able to detect this ‘//’ in the url.

Nginx send to my app ‘/site’ and not ‘//site’.

Seeing that my rails app had not the right info I tried to handle this
redirection at the nginx level but I had the same issue ; I am not able to
detect the ‘//’.

I tried to desactivate the merge slashes option but it did not change
anything

$uri and $request_uri still contained ‘/site’ and not ‘//site’

Do you have any idea why the first slash is skip ?

I tried to follow some examples but nothing worked :/

http://rosslawley.co.uk/archive/old/2010/01/10/nginx-how-to-url-cleaning-removing/
http://bneijt.nl/blog/post/nginx-and-the-extra-slashes/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

double slashes redirection

Benoit Vasseur October 06, 2014 05:20AM

Re: double slashes redirection

B.R. October 06, 2014 06:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 235
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