码迷,mamicode.com
首页 > Web开发 > 详细

CentOS7下让Asp.Net Core的网站自动运行

时间:2019-03-28 15:17:57      阅读:503      评论:0      收藏:0      [点我收藏+]

标签:conf   proxy   sys   live   nginx   div   environ   forward   top   

一、安装Nginx

yum install nginx

二、配置Nginx

vi /etc/nginx/nginx.conf

location / {
            proxy_pass http://127.0.0.1:5000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection keep-alive;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_cache_bypass $http_upgrade;
        }

  

三、设置Nginx开机启动

systemctl enable nginx.service

四、安装守护进程工具

yum install supervisor

五、配置守护进程信息

cd /etc/supervisord.d

vi videoserver.ini

[program:VideoServer.Site]
command=dotnet VideoCheckServer.dll
directory=/usr/bin/videoserver
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
stderr_logfile=/var/log/videoserver.err.log    
stdout_logfile=/var/log/videoserver.out.log

supervisord -c /etc/supervisord.conf

六、设置开机启动守护工具

systemctl enable supervisord.service

CentOS7下让Asp.Net Core的网站自动运行

标签:conf   proxy   sys   live   nginx   div   environ   forward   top   

原文地址:https://www.cnblogs.com/wdw984/p/10615018.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!