mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-04-05 12:22:09 +07:00
default vhost on HTTPS redirect
This commit is contained in:
@@ -138,7 +138,7 @@ server {
|
|||||||
#
|
#
|
||||||
server {
|
server {
|
||||||
{% for port in __listen %}
|
{% for port in __listen %}
|
||||||
listen {{ port }};
|
listen {{ port }}{% if nginx_default_vhost == __main_name %} default_server{% endif %};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
server_name {% if item.name is string %}{{ item.name }}{% else %}{{ item.name | join(' ') }}{% endif %};
|
server_name {% if item.name is string %}{{ item.name }}{% else %}{{ item.name | join(' ') }}{% endif %};
|
||||||
return 301 https://{{ __main_name }}{% if '443' not in __listen_ssl %}:{{ __listen_ssl[0] }}{% endif %}$request_uri;
|
return 301 https://{{ __main_name }}{% if '443' not in __listen_ssl %}:{{ __listen_ssl[0] }}{% endif %}$request_uri;
|
||||||
|
|||||||
Reference in New Issue
Block a user