我确实是一个 nginx 新手,所以请原谅我的错误等等。
两个 Glassfish 应用程序:
http://localhost:8080/app1 http://localhost:8080/app2
我想要的是:
Glassfish app1 服务于: http://www.example.com
Glassfish app2 服务于: http://www.example.com/app2
目前我有:
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; }
}
但路径混淆了。帮忙吗?