support the case for smartgears_special_redirect

This commit is contained in:
Andrea Dell'Amico 2018-10-25 12:37:17 +02:00
parent 6dd638ffee
commit 73fdaee1d9
1 changed files with 14 additions and 2 deletions

View File

@ -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 %}