nginx location regex tips
How to proxy pass only certain directory
eg
proxy only /doc/*/videos/*
but not like /doc/*/*/videos/*
before
/etc/nginx/conf.d/default.conf
location ~ ^/doc/ {
root /usr/share/nginx/html;
index index.html index.htm;
}
after
/etc/nginx/conf.d/default.conf
location ~* ^/doc/[^/]*/videos/ {
proxy_pass https://backend;
}
location ~ ^/doc/ {
root /usr/share/nginx/html;
index index.html index.htm;
}
Author And Source
この問題について(nginx location regex tips), 我々は、より多くの情報をここで見つけました https://qiita.com/tkprof/items/b1a4d5e9426c3289319a著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .