NGINX和TOMCAT配置动静分离端口丢失问题
来源:互联网 发布:php 判断数组长度 编辑:程序博客网 时间:2024/06/06 12:27
nginx 外网端口2002, tomcat 只能内网访问对应nginx端口9001,其中tomcat js 及 statics目录为静态目录,其它的请求全部proxy到tomcat .
关键配置 proxyPort="2002" , 这个不加的话就会端口丢失,缺省访问到80端口去。
还有另为一种解决办法,利用 nginx , proxy_redirect 也可以。
tomcat配置如下:
<Connector port="9001" proxyPort="2002" address="127.0.0.1" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
nginx配置如下:
server {
listen 2002;
server_name www.xxx.com;
# charset utf-8;
# access_log logs/host.access.log main;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:9001;
}
location ^~ /js/ {
root /mnt/web/fswh-cms-admin2002/waproot;
expires 24h;
}
location ^~ /statics/ {
root /mnt/web/fswh-cms-admin2002/waproot;
expires 15d;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /html;
}
}
- NGINX和TOMCAT配置动静分离端口丢失问题
- NGINX和TOMCAT配置动静分离端口丢失问题
- nginx,tomcat配置动静分离
- nginx tomcat 动静分离配置
- Nginx + Tomcat 动静分离
- nginx+tomcat动静分离
- nginx +tomcat 动静分离
- Tomcat+nginx 动静分离
- nginx+tomcat 动静分离
- nginx动静分离配置
- nginx非80端口单tomcat动静分离设置
- Nginx+Tomcat配置动静分离(附完整配置+注释)
- nginx+tomcat实现动静分离
- Nginx+Tomcat实现动静分离
- Nginx+Tomcat实现动静分离
- nginx+tomcat实现动静分离
- Nginx + Tomcat 实现动静分离
- Nginx + Tomcat 实现动静分离
- 人脸检测和识别及python实现系列(2)-- 相关API介绍与数据采集
- MPEG
- 数据分析(入门篇)-第三章-Show出你的数据-Part2(水晶易表)
- 关于notification的使用,setLatestEventInfo方法在新SDK不能使用的解决方法
- (八)适配器模式详解
- NGINX和TOMCAT配置动静分离端口丢失问题
- React Native 触摸事件处理详解
- 第四章 文件系统的内部表示
- mysql 连接查询的基本语法
- margin的知识点
- (九)模板方法模式详解(包含与类加载器不得不说的故事)
- linux命令mkdir: cannot create directory Permission denied
- Java精选笔记_其他IO流(ObjectInputStream、DataInputStream、PrintStream、标准输入输出流)
- Android Gradle Build Error:Some file crunching failed, see logs for details解决办法