move rewrite before location blocks

This commit is contained in:
Ulf Gebhardt 2022-01-08 05:55:00 +01:00
parent c777a5a9d8
commit 449e0933eb
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 12 additions and 13 deletions

View File

@ -25,6 +25,12 @@ server {
#gzip_static on;
# Legacy URLS
set $REWRITE_LEGACY_URLS "$NGINX_REWRITE_LEGACY_URLS";
if ($REWRITE_LEGACY_URLS = 'true') {
rewrite ^/vue$1 /$1 permanent;
}
# Frontend (default)
location / {
proxy_http_version 1.1;
@ -65,13 +71,6 @@ server {
proxy_redirect off;
}
# Legacy URLS
set $REWRITE_LEGACY_URLS "$NGINX_REWRITE_LEGACY_URLS";
if ($REWRITE_LEGACY_URLS = 'true') {
rewrite ^/vue$1 /$1 permanent;
}
# TODO this could be a performance optimization
#location /vue {
# alias /var/www/html/gradido/frontend/dist;

View File

@ -10,6 +10,12 @@ server {
#gzip_static on;
# Legacy URLS
set $REWRITE_LEGACY_URLS "$NGINX_REWRITE_LEGACY_URLS";
if ($REWRITE_LEGACY_URLS = 'true') {
rewrite ^/vue$1 /$1 permanent;
}
# Frontend (default)
location / {
proxy_http_version 1.1;
@ -50,12 +56,6 @@ server {
proxy_redirect off;
}
# Legacy URLS
set $REWRITE_LEGACY_URLS "$NGINX_REWRITE_LEGACY_URLS";
if ($REWRITE_LEGACY_URLS = 'true') {
rewrite ^/vue$1 /$1 permanent;
}
# TODO this could be a performance optimization
#location /vue {
# alias /var/www/html/gradido/frontend/dist;