Fix main name in vhosts

pull/14/head
Emilien Mantel 2016-01-12 09:27:53 +01:00
parent 8a30223bb9
commit ad9c0fa979
1 changed files with 4 additions and 4 deletions

View File

@ -40,7 +40,7 @@ server {
{% if item.root is defined %} {% if item.root is defined %}
root {{ item.root }}; root {{ item.root }};
{% else %} {% else %}
root {{ nginx_root }}/{{ item.name if item.name is string else item.name[0] }}/public; root {{ nginx_root }}/{{ __main_name }}/public;
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block template_index %} {% block template_index %}
@ -103,12 +103,12 @@ server {
{% endif %} {% endif %}
{% if item.use_access_log is defined and item.use_access_log %} {% if item.use_access_log is defined and item.use_access_log %}
access_log {{ nginx_log_dir }}/{{ item.name[0] }}_access.log combined; access_log {{ nginx_log_dir }}/{{ __main_name }}_access.log combined;
{% else %} {% else %}
access_log off; access_log off;
{% endif %} {% endif %}
{% if item.use_error_log is defined and item.use_error_log %} {% if item.use_error_log is defined and item.use_error_log %}
error_log {{ nginx_log_dir }}/{{ item.name[0] }}_error.log {{ nginx_error_log_level }}; error_log {{ nginx_log_dir }}/{{ __main_name }}_error.log {{ nginx_error_log_level }};
{% else %} {% else %}
error_log off; error_log off;
{% endif %} {% endif %}
@ -123,7 +123,7 @@ server {
listen {{ port }}; listen {{ port }};
{% endfor %} {% endfor %}
server_name {{ item.redirect_from | join(' ') }}; server_name {{ item.redirect_from | join(' ') }};
return 301 $scheme://{{ item.name[0] }}$request_uri; return 301 $scheme://{{ __main_name }}$request_uri;
} }
{% endif %} {% endif %}