Answer the question
In order to leave comments, you need to log in
How to replace URL in browser in NGINX+TOMCAT bundle?
nginx proxies incoming connections to the local tomcat with the application deployed to it as follows:
upstream tomcat {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
server_name domain.com;
location / {
proxy_pass http://tomcat/app/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
rewrite ^/app/(.*)$ /$1 last;
}
location /app {
rewrite ^/app(.*)$ $1 redirect;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question