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.