Nginx负载平衡器配置

Nginx负载平衡器配置,nginx,load-balancing,Nginx,Load Balancing,我的要求是负载平衡两个运行在两个独立节点中的ESBWeb服务(10.110.6.29,10.110.6.45)我使用的是nginx,安装在10.110.6.45中。基本上,当我向10.110.6.45(端口80)发送请求时,两个节点的负载应均衡 下面是/etc/nginx/nginx.conf user www; worker_processes 1; events { worker_connections 1024; } http { include m

我的要求是负载平衡两个运行在两个独立节点中的ESBWeb服务
(10.110.6.29,10.110.6.45)
我使用的是nginx,安装在10.110.6.45中。基本上,当我向
10.110.6.45(端口80)
发送请求时,两个节点的负载应均衡

下面是/etc/nginx/nginx.conf

user  www;
worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;    

    sendfile        on;

    keepalive_timeout  65;

    upstream esbhnbwso2.hnb.lk{
    server 10.110.6.45:8280;
    server 10.110.6.29:8280;
    }

    server {
        listen       80;
        server_name  localhost;


        location / {
            proxy_pass http://esbhnbwso2.hnb.lk;
            proxy_http_version 1.1;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }

}
当我尝试呼叫服务时
http://10.110.6.45/hnbceftapi
我将看到下面的nginx页面。 我做错了什么?任何帮助都将不胜感激

<html>
   <head>
      <meta content="HTML Tidy for Java (vers. 27 Sep 2004), see www.w3.org" name="generator"/>
      <title>404 Not Found</title>
   </head>
   <body bgcolor="white">
      <center>
         <h1>404 Not Found</h1>
      </center>
      <hr/>
      <center>nginx/1.14.2</center>
   </body>
</html>

404找不到
404找不到

nginx/1.14.2
通过一些网络阅读,我能够使nginx正常工作。这就是我的发现,心想 分享这些

我必须使用以下命令启用linux内部防火墙

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent  --zone=public --add-service=https
这些命令基本上将创建一个公共区域,并允许http(80)、https(443)通信

可以通过运行以下命令来验证允许的端口

firewall-cmd --list-ports
必须运行下面的命令才能允许httpd-http守护进程(nginx运行的apacheweb服务器)进行http通信

setsebool -P httpd_can_network_connect 1
这些配置是必需的,因为我正在使用的分发版是安全增强型Linux(SELinux)。我不是系统管理员,因此我不知道这些配置