w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Proxy_pass from foo.website.com to localhost:xxxx using nginx on docker - not localhost on physical machine

If I understand correctly, you want:

foo.website.com proxy pass to localhost:8181
bar.website.com proxy pass to localhost:3000

Try this:

server {  
    listen 80;
    server_name foo.website.com;

    # foo.website.com proxy pass to localhost:8181

    location / {
        proxy_pass http://127.0.0.1:8181;
        proxy_set_header Host $host;
    }
}
server {
    listen 80;
    server_name bar.website.com;

    # bar.website.com proxy pass to localhost:3000

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
    }
}




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.