标签:weight php lan res bin lis 负载 max col
nginx的配置内容 是用了lnmp 环境,在此基础上的修改
开启了两个服务器,
192.168.56.102:8080
192.168.56.1:81
# 添加服务器列表,真实对应的服务器都在下面
# weight 权重,数字越大,被分配的可能性越高
#
upstream new_pool { server 192.168.56.102:8080 weight=4 max_fails=2 fail_timeout=30s; server 192.168.56.1:81 weight=4 max_fails=2 fail_timeout=30s; } server { listen 80; server_name www.new.com ; location / { proxy_pass http://new_pool; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } include rewrite/none.conf; include enable-php.conf; location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { proxy_pass http://new_pool; # 图片代理 expires 30d; } location ~ .*\.(js|css)?$ { proxy_pass http://new_pool; # js/css 代理 expires 12h; } location ~ /.well-known { allow all; } location ~ /\. { deny all; } access_log off; }
本文参考:https://www.cnblogs.com/youzhibing/p/7327342.html
标签:weight php lan res bin lis 负载 max col
原文地址:https://www.cnblogs.com/xiaobaiskill/p/9983093.html