Proxy_pass and slash witch nginx

myckeul nginx-forum at
Wed May 18 20:11:33 MSD 2011


I set up a reverse proxy for a client with Nginx.

I still have a problem when I click on a link but the name of the
directory doesn't end with a slash.

The proxy address is and all requests are returned to

Example: and reference works well inside but remains on

If I remove the slash of the end I don't have in
the address bar but (with slash at the end
because the other web server adds).

In the http headers I see a 301 but it is not handled by nginx visibly:

GET /test HTTP/1.1

User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-us,en;q=0.5

Accept-Encoding: gzip, deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 115

Connection: keep-alive

Cookie: language1=en; language2=en

HTTP/1.1 301 Moved Permanently

Server: nginx/0.7.67

Date: Wed, 18 May 2011 07:15:57 GMT

Content-Type: text/html; charset=iso-8859-1

Transfer-Encoding: chunked

Connection: keep-alive


Age: 108

I thought to rewrite the rules but it might cause trouble.

If anyone has an idea on the subject, I'm interested.

Thank you

Posted at Nginx Forum:,198964,198964#msg-198964

More information about the nginx mailing list