mashirochannel's recent timeline updates
mashirochannel

mashirochannel

V2EX member #240104, joined on 2017-07-13 15:38:14 +08:00
mashirochannel's recent replies
Jan 2, 2018
Replied to a topic by mashirochannel NGINX nginx 代理中 jsp 里 basepath 路径的问题
@salmon5 还是不行呢
Dec 28, 2017
Replied to a topic by mashirochannel NGINX nginx 代理中 jsp 里 basepath 路径的问题
@salmon5 表达能力确实很差。。
Dec 28, 2017
Replied to a topic by mashirochannel NGINX nginx 代理中 jsp 里 basepath 路径的问题
我是做了两次代理 第一次
服务器 A nginx 到 tomcat docker (因为 A 上有多个 tomcat 实例,所以要反代)
server {
listen 9090;
server_name xxx.xxx.com;
location / {
proxy_redirect off;
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_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_pass http://xxx:8080;
}

}
服务器 B
第二次
listen 80 ;

server_name xxx2.xxx.com;

location / {
proxy_redirect off;
proxy_set_header Host xxx.xxx.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://xxx.xxx.com:9090;
}
如果直接从 B 带到 A 的 tomcat 是可以的,但是代了两次就不行了
@xupefei 好吧,谢谢提醒
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5273 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 05:46 · PVG 13:46 · LAX 22:46 · JFK 01:46
♥ Do have faith in what you're doing.