fix redirect https : show port only if not 443

This commit is contained in:
Emilien Mantel
2017-04-13 15:16:53 +02:00
parent f1af8991fd
commit a60e81cc1f
2 changed files with 9 additions and 8 deletions

View File

@@ -28,7 +28,7 @@ server {
listen {{ port }}{% if port | int in __http_proxy_protocol_port %} proxy_protocol{% endif %};
{% endfor %}
server_name {{ name }};
return 301 https://{{ name }}{% if '443' not in __listen_ssl %}:{{ __listen_ssl[0] }}{% endif %}$request_uri;
return 301 https://{{ name }}{% if '443' not in __listen_ssl and 443 not in __listen_ssl %}:{{ __listen_ssl[0] }}{% endif %}$request_uri;
}
{% endmacro %}