5、nginx配置

1、安装

sudo apt-get install nginx

2、启用

sudo service nginx start

3、若要将 Nginx 配置为转发请求向 ASP.NET Core 应用程序的反向代理,修改/etc/nginx/sites-available/default 。 在文本编辑器中打开它,并将内容替换为以下内容:  

服务器没有域名,可以写成test即可
server { listen
80; server_name test.com *.test.com; location / { proxy_pass http://localhost:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $http_host; proxy_cache_bypass $http_upgrade; } }

4、相关命令

//测试配置
sudo nginx -t //重新加载配置
sudo nginx
-s reload
原文地址:https://www.cnblogs.com/feihusurfer/p/11997437.html