🔖 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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue