So I have a Java (Spring 4 + Shiro) web app running in Tomcat7 on dedicated server. I'm trying to configure Nginx so that my application would be reachable by simply going to www.example.com instead of www.example.com/webappname.
With this configuration:
server {
server_name www.example.com example.com;
location / {
proxy_pass http://localhost:8080/;
}
}
All works well when i go t www.example.com/webappname. I can log in and everything works smoothly.
When I change to:
server {
server_name www.example.com example.com;
location / {
proxy_pass http://localhost:8080/mywebappname/;
proxy_redirect http://localhost:8080/mywebappname/ /;
}
}
I can access the application simply through www.example.com, shiro automatically redirects to www.example.com/login;jsessionid=CE70703C4BFBF7A258E4926324D5ECD2
I can log in, but then clicking any link inside results in ending up on the login page again as if the cookies are not there or something. I can't figure this one out. Any advice?