nginx proxy_pass POST 404错误

nginx proxy_pass POST 404错误,post,nginx,proxypass,Post,Nginx,Proxypass,我使用以下配置将nginx代理到应用服务器: location /app/ { # send to app server without the /app qualifier rewrite /app/(.*)$ /$1 break; proxy_set_header Host $http_host; proxy_pass http://localhost:9001; proxy_redirect http://lo

我使用以下配置将nginx代理到应用服务器:

location /app/ {
        # send to app server without the /app qualifier
        rewrite /app/(.*)$ /$1 break;
        proxy_set_header Host $http_host;
        proxy_pass http://localhost:9001;
        proxy_redirect http://localhost:9001 http://localhost:9000;
    }
任何对/app的请求都会转到:9001,而默认站点的主机是:9000

让请求正常工作。但是,每当我向/app/any/POST/url提交POST请求时,都会导致404错误。通过GET/app/any/post/url直接在浏览器中点击url会按预期点击应用服务器

我在网上找到了其他有类似问题的人,并补充说

代理设置头主机$http\U主机; 但这并没有解决我的问题

任何见解都将不胜感激


谢谢。

我的错,问题不是nginx,是我的应用服务器。我使用的是一个路由模块,它要求我在不是get的情况下显式指定请求方法,这就是为什么它会在post上抛出404错误,而不是在直接点击浏览器url时