Nginx反向代理没有按预期传递请求

我有一个Nginx反向代理启动并运行。 它也提供了一个Web应用程序的前端静态内容。 但是,反向代理没有传递请求。

发生什么事情是,当我尝试从静态页面login时,它正在对http://localhost/apps/iv/rest/Login进行POST。 不过,我需要这个POST到http://localhost/iv360/apps/iv/rest/Login 。 我以为我用/apps/iv/rest/ location块正确,但它似乎没有工作。

这是我完整的configuration文件。

 events { worker_connections 1024; } http { upstream https_iv360 { server localhost:9443; } upstream http_iv360 { server localhost; } server { listen 80; location / { proxy_pass https://https_iv360/iv360/; } location /apps/iv/rest/ { proxy_pass http://http_iv360/iv360/; } location /apps/iv/resources/ { root /www/data; } } } 

这里是Nginx日志的错误。

 2017/11/16 13:26:43 [error] 11132#0: *586 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "POST /apps/iv/rest//Login?appType=iv360&app_type=iv360 HTTP/1.1", upstream: "http://[::1]:80/iv360/Login?appType=iv360&app_type=iv360", host: "localhost", referrer: "http://localhost/apps/iv/resources/index.html"