From 449e0933ebe3907e46af477c272cb1f1745c307c Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 8 Jan 2022 05:55:00 +0100 Subject: [PATCH] move rewrite before location blocks --- .../nginx/sites-available/gradido.conf.ssl.template | 13 ++++++------- .../nginx/sites-available/gradido.conf.template | 12 ++++++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template b/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template index 9a891d1ac..8fa8d746f 100644 --- a/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template +++ b/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template @@ -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; @@ -64,13 +70,6 @@ server { proxy_pass http://127.0.0.1:8080/; 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 { diff --git a/deployment/bare_metal/nginx/sites-available/gradido.conf.template b/deployment/bare_metal/nginx/sites-available/gradido.conf.template index b48e6da7b..4464e407e 100644 --- a/deployment/bare_metal/nginx/sites-available/gradido.conf.template +++ b/deployment/bare_metal/nginx/sites-available/gradido.conf.template @@ -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;