这是使用WSL来代替Ubuntu环境
下载.Net Core SDK :
sudo apt-get install dotnet-sdk-3.1
安装完成,下载Nginx:
sudo apt install nginx
安装完成,启动Nginx:
sudo nginx
替换etc\nginx\sites-available下default文件:
server {
listen 80;
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 $host;
proxy_cache_bypass $http_upgrade;
}
}
查看是否有问题:
nginx -t
刷新配置:
nginx -s reload
查看Nginx状态:
service nginx status
cd转到.Net Core项目目录,执行:
dotnet WebApplication1.dll //项目名dll
完毕