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

1. 安装 .net core到centos7

2. 安装nginx        

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

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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

posted @   iDEAAM  阅读(1653)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
历史上的今天:
2015-09-01 HTML URL 编码
2014-09-01 使用 Visual Studio 生成通用的 XAML 应用程序 (Windows Phone 和 Windows 通用程序)
2014-09-01 How Do I Deploy a Windows 8 App to Another Device for Testing?
点击右上角即可分享
微信分享提示