Hi everyone,
I already apologize if this question has already been answered but i cannot make it work.
Here is my problem:
Nginx is serving the static files and is also connected to Tomcat.
So i proxy_pass :
proxy_pass http://127.0.0.1:8080/stage in my config file
i use also :
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
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_pass_header Set-Cookie;
rewrite ^/stage/(.*)$ /$1 permanent;
The rewrite makes the URLs working properly.
The problem is that i cannot login on my website because the cookie path delivered by nginx is incorrect:
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 23 Mar 2011 11:15:09 GMT
Content-Type: text/html;charset=UTF-8
Connection: close
Vary: Accept-Encoding
Set-Cookie: JSESSIONID=B588382489FA5F369C9617DEF09E31E3; Path=/stage
Content-Language: en-US
Length: unspecified [text/html]
The Path should be '/' : Path=/
I know that i can configure the tomcat connector but i don't like this solution (anyway, it created problem in tomcat also). I would like the change the Cookie Path to '/' by only managing the nginx configuration.
by the way, ProxyPassReverseCookiePath /stage / works fine with Apache ;) but i would like to change to Nginx :)
Thank you for you help