I am really a nginx newbie so please excuse the mistakes etc.
The domain: http://www.example.com
The 2 glassfish apps:
http://localhost:8080/app1 http://localhost:8080/app2
What I'd like:
Glassfish app1 served at: http://www.example.com
Glassfish app2 served at: http://www.example.com/app2
At the moment I have:
server {
listen 80;
server_name example.com www.example.com;
location / {
proxy_pass http://localhost:8080/app1/;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass_header Set-Cookie;
proxy_pass_header X-Forwarded-For;
proxy_pass_header Host; }
location /app2/ {
proxy_pass http://localhost:8080/app2/;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass_header Set-Cookie;
proxy_pass_header X-Forwarded-For;
proxy_pass_header Host; }
}
But the paths get mixed up. Help?