Reputation: 24207
I would like to setup my Nginx server so
/app/portnum
type URLs are reverse proxied to
localhost:portnum
E.g.
/app/1234
would be reverse proxied to
localhost:1234
Upvotes: 1
Views: 1506
Reputation: 9082
This may be helpful:
server {
listen 80;
server_name test1.test.com;
location ~ ^/app/(.*)$ {
proxy_pass http://192.168.154.102:$1;
}
}
Notice: If you visit test1.test.com/app/8081
, nginx will pass the request to http://192.168.154.102:8081/app/8081
.
More information about proxy_pass
Upvotes: 5