基于.NET Core 3.1 网站开发和部署的方法
cd /var/www/HotelWeb/ dotnet HotelWeb.dll [root@centos7 HotelWeb]# dotnet HotelWebMVC.dll info: Microsoft.Hosting.Lifetime[0] Now listening on: :5000 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: /var/www/HotelWeb 5.安装Nginx并配置 yum install nginx vim /etc/nginx/nginx.conf --------------- # 删除nginx默认的server,添加下面两个 server { listen 80 default_server; return 444; } server { listen 80; server_name *.hotel.com; location / { proxy_pass :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; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } ---------------- 6.启动nginx systemctl start nginx nginx -t # 配置确认没有问题后,重新载入配置 nginx -s reload 7.浏览器测试 修改win7的host 192.168.30.110 8.最后的问题 因为libgdiplus这个库没有安装,所以进入验证码的页面会有报错。 (编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |