首页 > 解决方案 > 在 ubuntu 服务器上部署 asp.net 核心应用程序时,nginx 存在重定向问题

问题描述

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

在此处输入图像描述

在此处输入图像描述

标签: asp.netubuntunginx

解决方案


你应该试试这个

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; 
}

推荐阅读