-1

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.

MadHatter
  • 78,442
  • 20
  • 178
  • 229
Michael A.
  • 101
  • 2

1 Answers1

0

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

3molo
  • 4,340
  • 5
  • 30
  • 46
  • 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. – Michael A. Jun 07 '11 at 17:39