🔖 nginx demo
parent
53a209b76d
commit
c09b291761
|
@ -0,0 +1,26 @@
|
|||
#设定负载均衡的服务器列表
|
||||
upstream demo02-server {
|
||||
# weigth参数表示权值,权值越高被分配到的几率越大
|
||||
server 127.0.0.1:9011 weight=5;
|
||||
server 127.0.0.1:9012 weight=1;
|
||||
server 127.0.0.1:9013 weight=6;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name www.demo02.com;
|
||||
|
||||
charset utf-8;
|
||||
proxy_connect_timeout 180;
|
||||
proxy_send_timeout 180;
|
||||
proxy_read_timeout 180;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
|
||||
# root /home/nginx/demos;
|
||||
root ../../../javaapp/src/main/webapp;
|
||||
|
||||
location / {
|
||||
proxy_pass http://demo02-server;
|
||||
}
|
||||
}
|
|
@ -21,8 +21,8 @@ http {
|
|||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
include mime.types;
|
||||
include demos/*.conf;
|
||||
|
|
Loading…
Reference in New Issue