【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 ...
随机推荐
- java基础知识总结--多线程
1.扩展Java.lang.Thread类 1.1.进程和线程的区别: 进程:每个进程都有自己独立的代码和数据空间(进程上下文),进程间的切换会有较大的开销,一个进程包含1~n个线程. 线程:同一类线 ...
- Ajax实现局部数据交互的一个简单实例
想要实现的功能:利用Ajax技术通过点击一个<button>按钮,然后在指定的文本框中输出想要的值. 1.使用Jsp创建一个前端页面. <body> <div style ...
- 使用itchat实现一个微信机器人聊天回复功能
近看到好多群里都有一个@机器人的功能,挺有趣的,想自己也玩下,就通过百度一点点实现,在这总结一下整个从无到有的过程. 首先,要知道itchat,它是Python写的,所以想要实现这个机器人的功能,需要 ...
- Codeforces Round #419 (Div. 2) ABC
python 2.7,用来熟悉Python 由于都是智障题,所以我也不讲述题意和题解,直接贴代码了-- A import sys h,m = map(int,raw_input().split(&qu ...
- Using async-await on .net 4
I'm currently starting to create an application that would profit a lot from C# 5's async-await feat ...
- SharePoint 读取内容的插件之SharepointPlus
前言 最近,一直在前端和SharePoint进行交互,然后,发现一个好用的插件,分享给大家. 首先,需要添加一个引用,如下图: 当然,我这里只是举个例子,亲们一定要去下载这个库,然后传到服务器或者文档 ...
- Lua MD5加密字符串
function md5_sumhexa(k) local md5_core = require "md5.core" k = md5_core.sum(k) return (st ...
- Kubernetes中的Configmap和Secret
本文的试验环境为CentOS 7.3,Kubernetes集群为1.11.2,安装步骤参见kubeadm安装kubernetes V1.11.1 集群 应用场景:镜像往往是一个应用的基础,还有很多需要 ...
- ConditionalOnProperty
配置Spring Boot通过@ConditionalOnProperty来控制Configuration是否生效 1.matchIfMissing属性:从application.properties ...
- [转]通过设置nginx的client_max_body_size解决nginx+php上传大文件的问题
转:http://blog.csdn.net/zhengwish/article/details/51602059 通过设置nginx的client_max_body_size解决nginx+php上 ...