nginx代理 flink Dashboard、sentinel dashboard的问题
nginx代理 flink web、sentinel dashboard的坑
- Nginx反向代理Flink Dashboard和Sentinel Dashboard的问题
-
- 问题背景
- 问题分析(sentinel为例)
- 原理解析
-
- 1. 尾部斜杠的重要性
- 2. 修复方案的工作原理
- 3. 代理配置的细节
- 解决方案
- 经验总结
Nginx反向代理Flink Dashboard和Sentinel Dashboard的问题
问题背景
在使用Nginx反向代理Apache Flink Dashboard和Sentinel Dashboard时,遇到了页面无法正常加载的问题。初始配置如下:
location /flink {proxy_pass http://flink/;proxy_set_header Host $host:$server_port;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;}location /sentinel {proxy_pass http://sentinel/;proxy_set_header Host $host:$server_port;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;}
配置完成后访问http://nginx-host/sentinel和http://nginx-host/flink,虽然能够连接到后端服务,但页