location + proxy pass = 404
emejibka
nginx-forum на forum.nginx.org
Пт Июн 19 06:37:03 UTC 2020
Всем спасибо.
В итоге сделал такой конфиг
...
map $request_uri $topdir {
~(?<captured_topdir>^/[a-zA-Z0-9]+[/]) $captured_topdir;
}
...
server {
listen 80;
server_name _;
proxy_set_header Accept-Encoding "gzip,deflate";
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
gzip off;
gunzip on;
location /test/ {
proxy_pass https://some_service/;
sub_filter "'/" "'$topdir";
sub_filter '"/' '"$topdir';
sub_filter_once off;
}
...
Posted at Nginx Forum: https://forum.nginx.org/read.php?21,288370,288397#msg-288397
Подробная информация о списке рассылки nginx-ru