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;