`
upstream leizi {
#machine0
server 10.128.25.28:8090 weight=1;
#machine1
server 10.128.27.239:8090 weight=1;
}`
`
listen 5000;
server_name 10.128.27.239;
location /jysms/machine0 {
proxy_pass http://10.128.25.28:8090; #请求转向machine0的服务器列表
proxy_redirect default;
proxy_set_header Host $http_host;
proxy_set_header RBody $request_body;
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;
}
location /jysms/machine1 {
proxy_pass http://10.128.27.239:8090; #请求转向machine1的服务器列表
proxy_redirect default;
proxy_set_header Host $http_host;
proxy_set_header RBody $request_body;
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;
}
location /jysms/ {
proxy_pass http://leizi; #请求转向leizi定义的服务器列表
proxy_redirect default;
proxy_set_header Host $http_host;
proxy_set_header RBody $request_body;
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;
}`
我想jysms的随意转发到10.128.27.239或者10.128.25.28
/jysms/machine0固定转发到10.128.25.28
/jysms/machine1固定转发到10.128.27.239
但是这样写之后machine0还是会转发到10.128.27.239。
请问怎么写/jysms/下剔除/jysms/machine0和/jysms/machine1转发到http://leizi;
server {