I've got the webbapp at the server 1.1.1.1:8080/AppName/ Now I need to hide port and AppName dir URL part. So I installed Nginx on server 2.2.2.2 with virthost name test.com.
Here is the virthost config:
server {
listen 80;
server_name test.com;
location / {
proxy_pass http://1.1.1.1:8080/;
}
}
Port is hided but how can I mask out AppName? Now I run site as http://test.com/AppName/ but need http://test.com/
The following doesn't make success (too many redirects fail):
server {
listen 80;
server_name test.com;
location / {
proxy_pass http://1.1.1.1:8080/;
rewrite ^/(.*) http://test.com/AppName/$1 break;
}
}
Thanks in advance!
BTW if you sujest how to reach that wih Apache+mod_proxy I would apreciate much too.