loc: /aa ==> http://127.0.0.1:28080/aa
pro: /aa ==> http://127.0.0.1:8011/api/
其它: /aa ==> http://127.0.0.1:8022/api/
大佬们,原来只有 loc 和其它一切正常,加上 pro 就不行了,如何配置可以实现这个效果吗?似乎 if 里面 proxy_pass 不能有/api/地址
location /aa {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
if ($http_environment_name = "loc" ) {
proxy_pass http://127.0.0.1:28080;
break;
}
if ($http_environment_name = "pro" ) {
proxy_pass http://127.0.0.1:8011/api/;
break;
}
proxy_pass http://127.0.0.1:8022/api/;
}