怎么在linux 用nginx做代理 配置.net core

1. 安装 .net core到centos7

2. 安装nginx        

  配置代理: vim /opt/nginx/conf/nginx.conf

  

 server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

         location / {
                proxy_pass http://127.0.0.1:5000;
                proxy_set_header Connection "";
                proxy_http_version 1.1;
        }
}

  

  启动nginx: /opt/nginx/sbin/nginx

  停止nginx: /opt/nginx/sbin/nginx -s stop

  重启nginx:/opt/nginx/sbin/nginx -s reload

3. 用VS2015新建 .net core WEB项目。并发布。

4. COPY发布的文件到centos7

5. dotnet TEST.WEB.dll

6. 打开连接 localhsot:5000

原文地址:https://www.cnblogs.com/haoliansheng/p/5830935.html