前言:
最近在安排项目时要求实现负载均衡,有趣的是发明网上一搜全体都是以下相似的配置文件
upstream localhost{
server 127.0.0.1:8080 weight=1;
server 127.0.0.1:8081 weight=1;
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass https://localhost;
index index.html index.htm index.jsp;
}
}up