.net core部署到Ubuntu
1.使用vs2017创建Asp.net Core Web应用程序,选择ubuntu中安装的.net core版本,这里选择2.1版本: 2.右键发布该项目,选择文件系统发布: 3.在ubuntu中安装vsftpd( Ubuntu安装vsftpd并通过xftp连接 ),并通过xftp将发布的publish目录上传到ubuntu服务器,也可以通过ftp直接发布到ubuntu,需要配置vsftpd,配置项比较多,可以参考: FTP服务器vsftpd配置详解 4.执行dotnet WebApp.dll,然后就可以在浏览器打开localhost:5000(5000为默认端口,如果有修改,请使用实际端口)但是现在还不能通过ip访问,这就需要Nginx实现 5.通过命令安装nginx(相当于linux下的iis) sudo apt-get install nginx 然后配置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