![nginx 重写规则:将 https://Frontend/backend/Api/SelectAllBranch/ 重写为 https://Backend/Api/SelectAllBranch/ 或 .../SelectAllBranch](https://linux22.com/image/772383/nginx%20%E9%87%8D%E5%86%99%E8%A7%84%E5%88%99%EF%BC%9A%E5%B0%86%20https%3A%2F%2FFrontend%2Fbackend%2FApi%2FSelectAllBranch%2F%20%E9%87%8D%E5%86%99%E4%B8%BA%20https%3A%2F%2FBackend%2FApi%2FSelectAllBranch%2F%20%E6%88%96%20...%2FSelectAllBranch.png)
我正在使用此配置来反向代理 nginx
location /backend {
rewrite ^/backend(.*)$ $1/ break;
proxy_pass http://credentials-web-bff.cl-milugar:5000;
proxy_redirect off;
}
当 Url 类似于 https://frontend/backend/mysite 时我没有遇到问题,但是当 Url 以“/”结尾时,此规则不起作用。
你们能帮助我吗?