之前写过一篇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配置自启动的更多相关文章

  1. 【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 ...

  2. .netcore部署Linux并结合Nginx反向代理 get started

    一..NetCore网站准备与发布 首先准备好一个ASP.NET Core Web应用程序,我这里就使用新建的示例站点作为demo演示,使用dotnet publish 命令发布网站. 或者使用VS的 ...

  3. 搭建nginx反向代理用做内网域名转发

    先上一个我的正常使用的配置 location / { proxy_pass http://192.168.1.84:80; proxy_redirect off; proxy_set_header H ...

  4. 把www.domain.com均衡到本机不同的端口 反向代理 隐藏端口 Nginx做非80端口转发 搭建nginx反向代理用做内网域名转发 location 规则

    负载均衡-Nginx中文文档 http://www.nginx.cn/doc/example/loadbanlance.html 负载均衡 一个简单的负载均衡的示例,把www.domain.com均衡 ...

  5. 端口被占用通过域名的处理 把www.domain.com均衡到本机不同的端口 反向代理 隐藏端口 Nginx做非80端口转发 搭建nginx反向代理用做内网域名转发 location 规则

    负载均衡-Nginx中文文档 http://www.nginx.cn/doc/example/loadbanlance.html 负载均衡 一个简单的负载均衡的示例,把www.domain.com均衡 ...

  6. 【.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 ...

  7. Centos 7.6配置nginx反向代理,直接yum安装

    一,实验介绍 利用三台centos7虚拟机搭建简单的nginx反向代理负载集群, 三台虚拟机地址及功能介绍 192.168.2.76    nginx负载均衡器 192.168.2.82    web ...

  8. Centos 7.6配置nginx反向代理负载均衡集群

    一,实验介绍 利用三台centos7虚拟机搭建简单的nginx反向代理负载集群, 三台虚拟机地址及功能介绍 192.168.2.76    nginx负载均衡器 192.168.2.82    web ...

  9. 搭建gerrit服务器(apache&nginx反向代理方式)

    这段时间,想搭建一个gerrit,用于代码托管,gerrit的搭建,网上有很多种教程,但是自己按照别人的教程逐步操作,一直出现诸多问题.最头痛的就是:Configuration Error Check ...

随机推荐

  1. vue中 如何使用less

    首先肯定是vue-cli全部就位: 1,安装依赖: npm install less less-loader --save 2,修改build-webpack.base.config.js文件,配置l ...

  2. sql 索引笔记

    以下资料来自MSDN. 数据库注意事项 设计索引时,应考虑以下数据库准则: 一个表如果建有大量索引会影响 INSERT.UPDATE 和 DELETE 语句的性能,因为在表中的数据更改时,所有索引都须 ...

  3. hdu3466 Proud Merchants(01背包)

    https://vjudge.net/problem/HDU-3466 一开始想到了是个排序后的背包,但是排序的策略一直没对. 两个物品1和2,当p1+q2>p2+q1 => q1-p1& ...

  4. PowerBI发布到网页

    如果网页当中需要嵌入PowerBI的报表,可以在PowerBI当中生成链接,然后网页或者博客当中插入这一段html代码. 以下是PowerBI生产网页链接的示例,并且在博客的最后也插入了PowerBI ...

  5. fastjson序列化乱序问题

    1.初始化为有序json对象 JSONObject jsonOrdered= new JSONObject(true); 2.将String对象转换过程中,不要调整顺序 JSONObject json ...

  6. Mysql中DDL, DML, DCL, 和TCL是什么?

    在一些公司中提交给测试团队的SQL脚本会划分为DDL.DML等,但这些概念到底是如何定义的呢? SQL(Structure Query Language)是数据库操作的的核心语言,接下来我们通过一张图 ...

  7. 遭遇ASP.NET的Request is not available in this context

    如果ASP.NET程序以IIS集成模式运行,在Global.asax的Application_Start()中,只要访问Context.Request,比如下面的代码 var request = Co ...

  8. 转: 关于CAS cpu锁的技术说明。

    写的不错.原文链接如下: https://blog.csdn.net/dviewer/article/details/51943140 部分摘要: 2016年07月18日 16:30:08 阅读数:3 ...

  9. iostat中的util和svctm (Two traps in iostat: %util and svctm)

    iostat, from the excellent sysstat suite of utilities, is the go-to tool for evaluating IO performan ...

  10. matplotlib 与 seaborn 中出现中文乱码的解决方法

      Linux.Mac osx 系统中,出现 matplotlib 或 seaborn 绘图中有中文乱码的情形,可以考虑使用以下方式处理: 到 anaconda 的 matplotlib 中查看是否有 ...