【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 ...
随机推荐
- 使用PrerenderSpaPlugin预渲染插件没有成功渲染
问题 在已有vue项目里使用prerender-spa-plugin插件时,遇到了build出来的页面是白屏或者出现{"statusCode":404,"error&qu ...
- JS_高程3.基本概念(2)
1.ECMAScript数据类型 5种简单数据类型,分别是: Undefined Null Boolean Number String 1种复杂数据类型: Object (1)typeof操作符——检 ...
- sql 索引笔记2
以下资料都来于MSDN. 聚集索引指南: 一.此列和列值供内部使用,用户不能查看或访问. 查询注意事项 在创建聚集索引之前,应先了解数据是如何被访问的.考虑对具有以下特点的查询使用聚集索引: 使用运算 ...
- 5、python的变量和常量
今天看看python的变量和常量,这是python中最基本的两个概念. 首先先说一下解释器执行Python的过程: python3 C:\test.py 1. 启动python解释器(内存中) ...
- python测试开发django-52.xadmin添加自定义的javascript(get_media)
前言 我想使用xadmin在列表页每一行元素添加一个按钮,当点击这个按钮的时候,能发个请求出去,后台执行相关功能.于是想到添加自定义的javascript脚本能实现. 在/stackoverflow上 ...
- /debug/requests is already registered. You may have two independent copies of golang.org/x/net/trace in your binary, trying to maintain separate state. This may involve a vendored copy of golang.org/x
找到问题就很好解决了,直接百度 go依赖管理-govendor go get -u github.com/kardianos/govendor 先获取这个,然后将govendor.exe放入path ...
- 微信小程序 --- Cannot read property 'setData' of null 解决
在外部定义一个为 this 的 that
- centos7下使用rpm包安装clickhouse
clickhouse是由俄罗斯Yandex公司开发的列式存储数据库,于2016年开源,clickhouse的定位是快速的数据分析,对于处理海量数据的情况性能非常好,在网上也有很多测试的案例,在大数据的 ...
- SSE图像算法优化系列二十二:优化龚元浩博士的曲率滤波算法,达到约1000 MPixels/Sec的单次迭代速度
2015年龚博士的曲率滤波算法刚出来的时候,在图像处理界也曾引起不小的轰动,特别是其所说的算法的简洁性,以及算法的效果.执行效率等方面较其他算法均有一定的优势,我在该算法刚出来时也曾经有关注,不过 ...
- 超图不支持JPEG格式的WMTS服务
就目前面而言,超图不支持JPEG格式的WMTS服务,只支持PNG格式的. <本篇完>