修改nginx.conf

#在http和server之间加入这个模块 
upstream guaji{
server 127.0.0.1:8080;
server 127.0.0.2:8080;
server 127.0.0.3:8080; }

nginx.conf的server

server {
  listen 80;
  server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
   proxy_pass http://guaji;
    # root html;
    #index index.html index.htm; }
}
修改nginx1.conf
server {
        listen       8080;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html;
index index.html index.htm; }
}

修改nginx.conf(第二个从机)

server {
listen 8080;#只修改这里
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root html;
index index.html index.htm; }
}

同理修改第三个从机的nginx.conf

修改index.html

然后重启就ok

相关文章:

  • 2021-03-28
  • 2021-10-09
  • 2021-11-06
  • 2022-12-23
  • 2021-11-06
  • 2022-01-17
  • 2021-11-19
  • 2021-11-06
猜你喜欢
  • 2022-02-05
  • 2021-07-31
  • 2022-01-05
  • 2022-02-19
  • 2022-12-23
  • 2021-07-13
  • 2021-07-03
相关资源
相似解决方案