Ubuntu 18.04 LTS 上配置 .net core 2.2 + nginx

前提条件

.net core 2.2 sdk     nginx

.net core

dotnet run --urls="http://*:5005"  #指定端口启动

 

nginx

文件 /etc/nginx/sites-available/default


upstream JQ1{
    server 127.0.0.1:6001 fail_timeout=60s;# 两个.net core 站点
    server 127.0.0.1:5001 fail_timeout=60s;#
}
server {
    listen 80 default_server;
    listen [::]:80 default_server;

 

    server_name _;

     location / {
        proxy_pass http://JQ1;
        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;
    }

常用命令

sudo nginx -t #检查Nginx配置

sudo nginx -s reload #重启Nginx

 

Supervisor

/etc/supervisor/conf.d/site.conf

[program:site]
command=dotnet bin/Debug/netcoreapp2.2/publish/myWebAppp.dll 
directory=/webs/myWebAppp
environment=ASPNETCORE__ENVIRONMENT=Production
stopsignal=INT
autostart=true
autorestart=true
startsecs=3   
stderr_logfile=/var/log/ossoffical.err.log  
stdout_logfile=/var/log/ossoffical.out.log  

 

https://www.cnblogs.com/jhli/p/10042304.html

 

ubuntu mysql 配置

https://blog.csdn.net/weixx3/article/details/80782479

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值