之前写过一篇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. PAT基础6-1

    6-1 简单输出整数 (10 分) 本题要求实现一个函数,对给定的正整数N,打印从1到N的全部正整数. 函数接口定义: void PrintN ( int N ); 其中N是用户传入的参数.该函数必须 ...

  2. Build fails with an error: Execution failed for task ':react-native-google-analytics-bridge:compileDebugJavaWithJavac'.

    1,问题 Build fails with an error: Execution failed for task ':react-native-google-analytics-bridge:com ...

  3. How to do conditional auto-wiring in Spring?

    ou can implement simple factory bean to do the conditional wiring. Such factory bean can contain com ...

  4. wriesharek同时监听多个端口

    之前的文章<wireshark解析自定义的protobuf协议> ,当时只监听了一个端口,而如果游戏同时有二个 socket 连接,比如一个是网关另外一个是其它的,怎么办呢? for i, ...

  5. pycharm 注册码/License server 2017年最新

    两种方法: 1.选License server激活,输入:http://idea.imsxm.com 2.2017年激活码 时效1年BIG3CLIK6F-eyJsaWNlbnNlSWQiOiJCSUc ...

  6. 中国大学MOOC-陈越、何钦铭-数据结构-2017春

    中国大学MOOC-陈越.何钦铭-数据结构-2017春 学习地址 详细学习内容 Github记录地址 欢迎fork和star,有惊喜值得学习! 参考学习笔记 参考AC代码 数据结构和算法学习笔记 学习内 ...

  7. [Python设计模式] 第18章 游戏角色备份——备忘录模式

    github地址:https://github.com/cheesezh/python_design_patterns 题目 用代码模拟以下场景,一个游戏角色有生命力,攻击力,防御力等数据,在打Bos ...

  8. Linux 添加开机启动项的两种方法

      1.编辑文件 /etc/rc.localvim /etc/rc.local #!/bin/sh## This script will be executed *after* all the oth ...

  9. (整理)plsql导入dmp文件

    转载请注明出处: https://www.cnblogs.com/darkknightzh/p/10093063.html 参考网址: https://www.2cto.com/database/20 ...

  10. Docker入门 - 003 Docker 实例

    Docker Hello World Docker 允许你在容器内运行应用程序, 使用 docker run 命令来在容器内运行一个应用程序. 输出Hello world runoob@runoob: ...