【netcore基础】CentOS 7.6.1810 搭建.net core 2.1 linux 运行环境 nginx反向代理 supervisor配置自启动...
2020-01-13 00:55
459 查看
之前写过一篇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 404 /; error_page 500 502 503 504 /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 80; 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 404 /; error_page 500 502 503 504 /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=5 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
这里可以指定服务端口号,就可以部署多个不同端口的项目了
转载于:https://www.cnblogs.com/jhli/p/10448304.html
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- linux(centos)搭建.net core 运行环境
- CentOS 6.8_x64 Linux下基础环境搭建
- hadoop学习之HDFS(2.1):linux下eclipse中配置hadoop-mapreduce开发环境并运行WordCount.java程序
- 配置 ASP.NET Linux( CentOS 6.5 ) 运行环境 MONO + Jexus
- Centos6.5服务器环境搭建之安装Tomcat以及开机自启动的配置
- Linux(阿里云Centos7)环境下搭建svn服务器以及权限配置详细步骤
- CentOS上搭建Nginx+Mono运行asp.net环境的配置方法
- Centos搭建和基础环境配置
- centos下linux运行asp网站搭建配置-mono+nginx
- 3、单机运行环境搭建之 --CentOS-6.5安装配置Tengine
- 1、单机运行环境搭建之 --CentOS-6.5安装配置JDK-8
- 在CentOS 7 64位操作系统环境下搭建LNMP(Linux+Nginx+MySQL+PHP)来运行Zabbix监控程序
- 在CentOS 5 Linux环境下配置TurboGears 2.1
- centos shell基础 alias 变量单引号 双引号 history 错误重定向 2>&1 jobs 环境变量 .bash_history source配置文件 nohup & 后台运行 cut,sort,wc ,uniq ,tee ,tr ,split, paste cat> 2.txt <<EOF 通配符 glob模式 发邮件命令mail 2015-4-8 第十二节课
- 从零开始构建一个centos+jdk7+tomcat7的镜像文件 centos7系统下docker运行环境的搭建 准备centos基础镜像 docker pull centos 或者直接下载我准备
- centos搭建J2EE_CMS运行环境(jdk +tomcat +mysql配置)
- centOS下搭建Linux JDK环境以及配置
- 配置 ASP.NET Linux( CentOS 6.5 ) 运行环境 MONO + Jexus
- SAAS云平台搭建札记: (二)Linux Ubutu下.Net Core整套运行环境的搭建
- 2、单机运行环境搭建之 --CentOS-6.5安装配置Tomcat7