From 32930677b902cc5f735c19ed38dd150cee1dd67b Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 8 Jan 2022 05:44:04 +0100 Subject: [PATCH] legacy url rewrite support --- deployment/bare_metal/.env.dist | 2 +- .../nginx/sites-available/gradido.conf.ssl.template | 7 +++++++ .../bare_metal/nginx/sites-available/gradido.conf.template | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index fa64ae770..68852fbf7 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -1,8 +1,8 @@ -NGINX_SSL=false NGINX_SERVER_NAME=_ #Example data +#NGINX_REWRITE_LEGACY_URLS=true #NGINX_SSL=true #NGINX_SERVER_NAME=stage1.gradido.net #NGINX_SSL_CERTIFICATE=/etc/letsencrypt/live/stage1.gradido.net/fullchain.pem 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 8cffa43ba..a2b9ec900 100644 --- a/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template +++ b/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template @@ -65,6 +65,13 @@ 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; diff --git a/deployment/bare_metal/nginx/sites-available/gradido.conf.template b/deployment/bare_metal/nginx/sites-available/gradido.conf.template index 311c3646a..f523a0b81 100644 --- a/deployment/bare_metal/nginx/sites-available/gradido.conf.template +++ b/deployment/bare_metal/nginx/sites-available/gradido.conf.template @@ -50,6 +50,12 @@ 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;