【netcore基础】CentOS 7.6.1810 搭建.net core 2.1 linux 运行环境 nginx反向代理 supervisor配置自启动
之前写过一篇Ubuntu的环境搭建博客,感觉一些配置大同小异,这里重点记录下 nginx 作为静态 angular 项目文件服务器的配置
参考链接
【netcore基础】ubuntu 16.04 搭建.net core 2.1 linux 运行环境 nginx反向代理 supervisor配置自启动
Nginx配置
muc api接口服务的配置,域名(api.wxsale.gedu.org)转发到5000端口
如下:
server {
listen 80;
server_name api.wxsale.gedu.org;
root /app/web_root/api.wxsale.gedu.org;
index index.html index.htm;
try_files $uri $uri/ /index.html;
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_cache_bypass $http_upgrade;
}
error_page /;
error_page /50x.html;
location = /50x.html {
root html;
}
access_log /applog/nginxlog/api.wxsale.gedu.org_access.log main;
error_log /applog/nginxlog/api.wxsale.gedu.org_error.log; }
重点是配置域名,端口80指向5000,log日志文件路径
然后是 angular 项目,静态文件转发配置
如下:
server {
listen ;
server_name wxsale.gedu.org;
location / {
root /app/web_root/wxsale.gedu.org;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page /;
error_page /50x.html;
location = /50x.html {
root html;
}
access_log /applog/nginxlog/wxsale.gedu.org_access.log main;
error_log /applog/nginxlog/wxsale.gedu.org_error.log; }
配置差不多。
superior配置
[program:GeduFileServer]
command=dotnet GeduFileServer.dll --server.urls http://localhost:5100
directory=/app/web_root/file.wxsale.gedu.org
environment=ASPNETCORE__ENVIRONMENT=Production
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=
stderr_logfile=/app/web_root/file.wxsale.gedu.org/logfile/GeduDistributionApi.err.log
stdout_logfile=/app/web_root/file.wxsale.gedu.org/logfile/GeduDistributionApi.out.log
这里可以指定服务端口号,就可以部署多个不同端口的项目了
【netcore基础】CentOS 7.6.1810 搭建.net core 2.1 linux 运行环境 nginx反向代理 supervisor配置自启动的更多相关文章
- 【netcore基础】ubuntu 16.04 搭建.net core 2.1 linux 运行环境 nginx反向代理 supervisor配置自启动
今天来整理下 netcore 在 linux(ubuntu) 上的运行环境搭建 对应版本 ubuntu 16.04 .net core 2.1 nginx version: nginx/1.10.3 ...
- .netcore部署Linux并结合Nginx反向代理 get started
一..NetCore网站准备与发布 首先准备好一个ASP.NET Core Web应用程序,我这里就使用新建的示例站点作为demo演示,使用dotnet publish 命令发布网站. 或者使用VS的 ...
- 搭建nginx反向代理用做内网域名转发
先上一个我的正常使用的配置 location / { proxy_pass http://192.168.1.84:80; proxy_redirect off; proxy_set_header H ...
- 把www.domain.com均衡到本机不同的端口 反向代理 隐藏端口 Nginx做非80端口转发 搭建nginx反向代理用做内网域名转发 location 规则
负载均衡-Nginx中文文档 http://www.nginx.cn/doc/example/loadbanlance.html 负载均衡 一个简单的负载均衡的示例,把www.domain.com均衡 ...
- 端口被占用通过域名的处理 把www.domain.com均衡到本机不同的端口 反向代理 隐藏端口 Nginx做非80端口转发 搭建nginx反向代理用做内网域名转发 location 规则
负载均衡-Nginx中文文档 http://www.nginx.cn/doc/example/loadbanlance.html 负载均衡 一个简单的负载均衡的示例,把www.domain.com均衡 ...
- 【.NetCore学习】ubuntu16.04 搭建.net core mvc api 运行环境
查看linux内核版本 uname -a 打印结果 python@ubuntu:~$ uname -a Linux ubuntu 4.4.0-31-generic #50-Ubuntu SMP Wed ...
- Centos 7.6配置nginx反向代理,直接yum安装
一,实验介绍 利用三台centos7虚拟机搭建简单的nginx反向代理负载集群, 三台虚拟机地址及功能介绍 192.168.2.76 nginx负载均衡器 192.168.2.82 web ...
- Centos 7.6配置nginx反向代理负载均衡集群
一,实验介绍 利用三台centos7虚拟机搭建简单的nginx反向代理负载集群, 三台虚拟机地址及功能介绍 192.168.2.76 nginx负载均衡器 192.168.2.82 web ...
- 搭建gerrit服务器(apache&nginx反向代理方式)
这段时间,想搭建一个gerrit,用于代码托管,gerrit的搭建,网上有很多种教程,但是自己按照别人的教程逐步操作,一直出现诸多问题.最头痛的就是:Configuration Error Check ...
随机推荐
- Mybatis批量插入返回自增主键(转)
我们都知道Mybatis在插入单条数据的时候有两种方式返回自增主键: 1.对于支持生成自增主键的数据库:useGenerateKeys和keyProperty. 2.不支持生成自增主键的数据库:< ...
- Django REST framework API开发
RESTful设计方法 1. 域名 应该尽量将API部署在专用域名之下. https://api.example.com 如果确定API很简单,不会有进一步扩展,可以考虑放在主域名下. https:/ ...
- SpringCloud无废话入门05:Spring Cloud Gateway路由、filter、熔断
1.什么是路由网关 截至目前为止的例子中,我们创建了一个service,叫做:HelloService,然后我们把它部署到了两台服务器(即提供了两个provider),然后我们又使用ribbon将其做 ...
- golang使用chan注意事项
背景 最近老代码中遇到的一个问题,表现为: goroutine数量在高峰期上涨,上涨后平峰期将不下来.也就是goroutine泄露 使用pprof看,进程堵塞在chan chan的使用经验 在使用ch ...
- JAVA使用Logback发送日志到控制台、文件、ELK的最简单用法
一.简述 本文讲JAVA使用Logback发送日志到控制台.文件.ELK的最简单用法. 二.教程 1.新建pom.xml项目引入下列依赖: <dependencies> <!--Be ...
- dotnet ef
dotnet ef migrations add <Name-of-Migration> dotnet ef database update
- VirtualBox虚拟机磁盘瘦身
操作系统 : windows7_x64 VirtualBox 版本 : 4.3.28 原理: 使用0填充虚拟系统磁盘,然后删除填充文件,再使用VBoxManage进行压缩. Linux系统磁盘瘦身 一 ...
- Nginx——location匹配与在配置中的优先级
1. location表达式类型 location ^~ /api/v7/ { proxy_next_upstream http_404 http_500 http_502 http_503 http ...
- 解决Linux文件系统变成只读的方法
解决Linux文件系统变成只读的方法 解决方法 1.重启看是否可以修复(很多机器可以) 2.使用用 fsck – y /dev/hdc6 (/dev/hdc6指你需要修复的分区) 来修复文件系统 ...
- Effective Java 第三版——69. 仅在发生异常的条件下使用异常
Tips 书中的源代码地址:https://github.com/jbloch/effective-java-3e-source-code 注意,书中的有些代码里方法是基于Java 9 API中的,所 ...