【发布时间】:2020-11-07 10:50:50
【问题描述】:
我可以在 nginx/okd 配置中看到以下位置:
location /STFlow/ {
rewrite ^/STFlow(.*)$ $1 last;
#
# Are four lines below executed if rewrite has last option ???
# What's the point of them?
#
proxy_pass http://zuul-proxy:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $http_x_forwarded_for;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
}
location / {
add_header debug-header dbg5;
set $realip $remote_addr;
if ($http_x_forwarded_for ~ "^(\d+\.\d+\.\d+\.\d+)") {
set $realip $1;
}
proxy_pass http://zuul-proxy:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $http_x_forwarded_for;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
client_max_body_size 50M;
}
在location /STFlow/下面有四行rewrite ^/STFlow(.*)$ $1 last;执行过吗?
如果是什么时候?
它们的意义何在?
【问题讨论】:
标签: nginx nginx-reverse-proxy nginx-location nginx-config nginx-ingress