upstream backend {
ip_hash;
server 10.68.145.5:9091 weight=1 max_fails=1 fail_timeout=30;
server 10.68.145.4:9091 weight=1 max_fails=1 fail_timeout=30;
}

server {
listen 80;
server_name localhost;

 

location / {
root html;
index index.html index.htm;
}

location /api {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;

rewrite ^.+api/(.*)$ /haha/xixi/$1 break;
include uwsgi_params;
proxy_pass http://backend;
}

发表评论

邮箱地址不会被公开。 必填项已用*标注