diff --git a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 index 87daa580..77ce064c 100644 --- a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 +++ b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 @@ -165,13 +165,19 @@ server { proxy_pass http://127.0.0.1:{{ smartgears_http_port }}/$uri; } {% endif %} + {% if smartgears_special_redirect is defined %} + {% for target in smartgears_special_redirect %} + location {{ target.source_uri }} { + return 301 http://{{ target.dest_host }}/{{ target.dest_url }}; + } + {% endfor %} + {% endif %} {% else %} location / { return 301 https://{{ item.servername }}$request_uri; } {% endif %} - } {% if letsencrypt_acme_install %} @@ -343,6 +349,12 @@ server { proxy_pass http://127.0.0.1:{{ smartgears_http_port }}/$uri; } {% endif %} - + {% if smartgears_special_redirect is defined %} + {% for target in smartgears_special_redirect %} + location {{ target.source_uri }} { + return 301 http://{{ target.dest_host }}/{{ target.dest_url }}; + } + {% endfor %} + {% endif %} } {% endif %}