Forward scheme and http code added for redirection hosts

You can now configure the forward_scheme and forward_http_code on user interface (section redirection hosts)
This commit is contained in:
baruffaldi
2021-02-09 11:23:15 +01:00
parent ea28da90b2
commit 6df7b72e08
6 changed files with 61 additions and 4 deletions

View File

@ -18,9 +18,9 @@ server {
{% include "_hsts.conf" %}
{% if preserve_path == 1 or preserve_path == true %}
return 301 $scheme://{{ forward_domain_name }}$request_uri;
return {{ forward_http_code }} {{ forward_scheme }}://{{ forward_domain_name }}$request_uri;
{% else %}
return 301 $scheme://{{ forward_domain_name }};
return {{ forward_http_code }} {{ forward_scheme }}://{{ forward_domain_name }};
{% endif %}
}
{% endif %}