NGINX – upstream directive

Scenario:

we have a server running on a none standard port ie. 8080 and we want to proxy it via nginx to port 80

Solution:

use nginx upstream directive – basic example of that looks like this:

upstream mynode {
    server localhost:8080;
}

server {
    server_name www.mynode.local mynode;

    location / {
        proxy_pass http://mynode;
    }
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *

fourteen − 9 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.