美文网首页
centos7.4 nginx 配置多个代理

centos7.4 nginx 配置多个代理

作者: squidbrother | 来源:发表于2020-03-10 23:19 被阅读0次
概述

需求:
1.希望一级域名代理,node server的localhost:3000端口,实现 访问了一级域名就访问了3000端口对应的node服务
2.希望二级域名代理,node server的localhost:3002端口,实现 访问了二级域名就访问了3002端口对应的node服务

环境:
阿里云 centos 7.4 ECS
certbot 配置的ssl https协议

实现

1.阿里云 域名解析 ,添加二级域名解析
2.配置 nginx.conf 文件
2-1.复制一份已有的server部分,将server_name与代理的proxy_pass 修改
2-2.复制一份重定向 修改server_name

配置nginx1
配置nginx2

相关文章

网友评论

      本文标题:centos7.4 nginx 配置多个代理

      本文链接:https://www.haomeiwen.com/subject/xkfodhtx.html