diff --git a/library/roles/nginx/templates/nginx-virthost.j2 b/library/roles/nginx/templates/nginx-virthost.j2 index d8d377ee..d5f52b91 100644 --- a/library/roles/nginx/templates/nginx-virthost.j2 +++ b/library/roles/nginx/templates/nginx-virthost.j2 @@ -187,7 +187,11 @@ server { {% if item.ssl_enabled %} server { + {% if item.https_port is defined %} + listen {{ item.https_port }} {{ nginx_ssl_type }}; + {% else %} listen {{ https_port | default('443') }} {{ nginx_ssl_type }}; + {% endif %} server_name {{ item.server_name }} {% if item.serveraliases is defined %}{{ item.serveraliases }}{% endif %}; {% if item.access_log is defined %}