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; #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) # Frontend (default)
location / { location / {
proxy_http_version 1.1; proxy_http_version 1.1;
@ -64,13 +70,6 @@ server {
proxy_pass http://127.0.0.1:8080/; proxy_pass http://127.0.0.1:8080/;
proxy_redirect off; 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 # TODO this could be a performance optimization
#location /vue { #location /vue {

View File

@ -10,6 +10,12 @@ server {
#gzip_static on; #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) # Frontend (default)
location / { location / {
proxy_http_version 1.1; proxy_http_version 1.1;
@ -50,12 +56,6 @@ server {
proxy_redirect off; 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 # TODO this could be a performance optimization
#location /vue { #location /vue {
# alias /var/www/html/gradido/frontend/dist; # alias /var/www/html/gradido/frontend/dist;