nginx 'proxy_pass' 的位置不能有 URI 部分?

标签 nginx

我有一个 location block 为

location @test{
    proxy_pass http://localhost:5000/1;
}

但 nginx 提示 "proxy_pass cannot have URI part in location given by regular expression..."有谁知道可能出了什么问题?

上传完成后,我尝试查询 localhost:5000/1:
location /upload_attachment {
    upload_pass @test;
    upload_store /tmp;
    ...
}

最佳答案

尝试省略“/”(URI 部分)并检查。

location @test{
    proxy_pass http://localhost:5000;
}

关于nginx 'proxy_pass' 的位置不能有 URI 部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21662940/

相关文章:

nginx http auth request 模块只会返回默认的错误页面

python - 如何在遗留 Flask 应用程序中实现个性化 URL?

python - Nginx 的工作进程挂起并占用完整的 CPU

php - 将URL添加到错误日志(Wordpress,Nginx,PHP7)

通过 nginx 代理的 Docker 环境导致 502 Bad Gateway

nginx - 当第二个观看者加入时直播停止

nginx.service失败,因为控制进程退出

nginx - 相对链接不适用于 nginx 反向代理

macos - Mac 上的 Docker 测试版 : Cannot use ip to access nginx container

caching - Varnish 将不会缓存-年龄0