vhosts.j2 872 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. {% for vhost in nginx_vhosts -%}
  2. server {
  3. listen {{ vhost.listen | default('80 default_server') }};
  4. {% if vhost.server_name is defined %}
  5. server_name {{ vhost.server_name }};
  6. {% endif %}
  7. {%- if vhost.root is defined -%}
  8. root {{ vhost.root }};
  9. {% endif %}
  10. {%- if vhost.index is defined -%}
  11. index {{ vhost.index }};
  12. {% endif %}
  13. {%- if vhost.error_page is defined -%}
  14. error_page {{ vhost.error_page }};
  15. {% endif %}
  16. {%- if vhost.access_log is defined -%}
  17. access_log {{ vhost.access_log }};
  18. {% endif %}
  19. {%- if vhost.error_log is defined -%}
  20. error_log {{ vhost.error_log }} error;
  21. {% endif %}
  22. {%- if vhost.return is defined -%}
  23. return {{ vhost.return }};
  24. {% endif %}
  25. {%- if vhost.extra_parameters is defined -%}
  26. {{ vhost.extra_parameters }}
  27. {% endif %}
  28. }
  29. {% endfor %}