Score:0

NGINX reverse proxy on different port

in flag

I would like to set up a conf file, which basically listen to all request on a specific port on the nginx server, and all these request should be forwarded to a another group of servers which handle these request.

My set up is like this :

  • nginx.conf -> just the normal default coming after installation.

and the content of :

  • /etc/nginx/conf.d/load-balancer.conf
upstream backend {
    server 10.0.0.1:8080 max_fails=3;
    server 10.0.0.2:8080 max_fails=3;
    server 10.0.0.3:8080 max_fails=3;
}

server {
    listen 8081;

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

Additional info , we are running RedHat 7.9 and nginx 1.20.1. If I try to connect from web browser this URL : 10.0.0.1:8080

The web page is properly being displayed. But if I connect to the nginx server with : http://NGINX_SERVER:8081

it just open the default web page of nginx.

What am I missing ? Any idea ?

Thanks.

I ve tried with different port on nginx server but not working.

Damith Udayanga avatar
cn flag
check the selinux status first, if it is enabled try to access your application (http://NGINX_SERVER:8081) by disabling selinux.
Score:0
nf flag

You'll have to go into your domain names dns records settings and set up a service for that port also. Similar to this Minecraft server setup. https://www.name.com/support/articles/205188518-setting-up-dns-for-a-minecraft-server

adamski avatar
in flag
well thanks for your reply and time taken for it. But dont think DNS play a role here, because I explicitely specify IP.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.