标签:code tab port raw irb logs jpg ever size
(1)保证内网的安全,可以使用反向代理提供WAF功能,阻止web攻击大型网站,通常将反向代理作为公网访问地址,Web服务器是内网。
(2)负载均衡,通过反向代理服务器来优化网站的负载。
系统:centos 7
此处使用tomcat作为被代理的服务器
1 | - centos 7安装jdk |
修改tomcat配置,防止端口冲突(文件位置:tomcat/conf/server.xml
),只需要修改其中一个tomcat配置即可
修改ngxin配置(文件位置:nginx/conf/nginx.conf
)
第一种配置方式
1 | upstream tomcat-test1 { |
第二种配置方式
1 | upstream tomcat-test1 { |
运行tomcat,运行nginx
1 |
|
测试
nginx.conf
1 | ## 轮询,每个节点一次 |
配置nginx.conf
文件
1 | # erp项目 |
测试
使用域名能访问到是因为我配置了hosts IP映射,如果没有配置,请使用IP访问
标签:code tab port raw irb logs jpg ever size
原文地址:https://www.cnblogs.com/sanxiandoupi/p/11718102.html