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.

link|improve this question
feedback

1 Answer

How about proxy_pass http://tomcat:port/appname/?

link|improve this answer
No way. I get 404 Not Fount at the next response. But don't know exactly how to trace that and understand what's going on. – user83748 Jun 7 '11 at 17:39
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.