zoukankan      html  css  js  c++  java
  • 【Linux】使用Nginx发布dotnet的网站

    1.安装Nginx【自行百度】

    2.安装dotnet运行时【自行百度】

    3.配置Nginx——  /etc/nginx/conf.d/default.conf

    server {
        listen       80;
        server_name  localhost;
    
        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;
        }
    }

    将5000端口映射到80端口

    4.配置.net Core

        "Xuxml.Web": {
          "commandName": "Project",
          "launchBrowser": true,
          "launchUrl": "http://localhost:5000",
          "environmentVariables": {
            "ASPNETCORE_ENVIRONMENT": "Development"
          }
        }

    5.前4部是准备工作,完成了准备工作之后,上传网站的文件到服务器,进入网站目录结构下,敲发布代码

    查看目录 ls
    查看端口占用 netstat -ntlp
    结束端口  kill -9 【端口号】
    发布代码 nohup dotnet Xuxml.web.dll &netstat -ntlp

    6.发布完成


    如果有问题。欢迎各位大神指正呀!

  • 相关阅读:
    简单学习tar命令
    方向
    简单使用ubuntu
    双网卡同时上内外网
    emacs学习中
    IE8的开发者工具
    emacs编辑html
    推荐一款数据恢复软件EasyRecovery
    慢慢的乐趣
    关于一个汽车调度的排车问题
  • 原文地址:https://www.cnblogs.com/xuxml/p/10018454.html
Copyright © 2011-2022 走看看