打开nginx下面的conf文件夹下面的nginx.conf文件,如图

Nginx1.18.0版本负载均衡配置详细

 

 

nginx.conf文件配置,并保存,如图:
代码:
#定义集群
upstream backend_server{
server localhost:9001;
server localhost:9002;
}

listen 9000;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
# root html;
#index http://localhost:9000/;
proxy_pass http://backend_server;
}

Nginx1.18.0版本负载均衡配置详细

 

  

启动nginx

打开浏览器,输入地址,如图:
http://localhost:9000/接口地址

Nginx1.18.0版本负载均衡配置详细

 

 Nginx1.18.0版本负载均衡配置详细

 

相关文章:

  • 2022-01-12
  • 2021-08-26
  • 2021-11-21
  • 2021-10-17
  • 2021-11-19
  • 2021-11-21
猜你喜欢
  • 2021-09-08
  • 2021-10-28
  • 2021-08-24
  • 2021-11-18
  • 2021-08-26
  • 2021-05-20
相关资源
相似解决方案