0

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.

adamski
  • 1
  • 1
  • check the selinux status first, if it is enabled try to access your application (http://NGINX_SERVER:8081) by disabling selinux. – Damith Udayanga Apr 10 '23 at 05:50

1 Answers1

0

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

  • well thanks for your reply and time taken for it. But dont think DNS play a role here, because I explicitely specify IP. – adamski Apr 11 '23 at 06:58