Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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