nginx proxy_pass to localhost
I'm trying to use proxy_pass in nginx to forward requests to another port
on localhost like this:
location /foo {
rewrite ^/foo/(.*) /$1 break;
proxy_pass http://127.0.0.1:8080/;
}
location /bar {
rewrite ^/bar/(.*) /$1 break;
proxy_pass http://localhost:8080/;
}
location /blah {
rewrite ^/blah/(.*) /$1 break;
proxy_pass http://192.168.77.56:8080/;
}
So only the last one works. The first two give me a page-unavailable
error. I know the endpoint is working as I can go directly to
localhost:8080 and see output I expected.
Any idea what I'm doing wrong?
Thanks! Greg
No comments:
Post a Comment