在ubuntu服务器上部署asp.net核心应用程序时,nginx存在重定向问题

时间:2020-01-14 13:32:41

标签: asp.net ubuntu nginx

在部署asp.net核心应用程序时,我遇到了nginx服务器的问题,实际上它始终将其重定向到localhost,但是我在nginx配置文件上传递了proxy_pass http://127.0.0.1:5000

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:1)

您应该尝试

location / {
      # http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver
      resolver 127.0.0.1 valid=30s ipv6=off;
      # http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver_timeout
      # give up and response error 
      resolver_timeout 5s;
      proxy_pass http://127.0.0.1:5000; 
}