vhosts.j2 835 B

123456789101112131415161718192021222324252627282930313233
  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. index {{ vhost.index | default('index.html index.htm') }};
  11. {% if vhost.error_page is defined %}
  12. error_page {{ vhost.error_page }};
  13. {% endif %}
  14. {% if vhost.access_log is defined %}
  15. access_log {{ vhost.access_log }};
  16. {% endif %}
  17. {% if vhost.error_log is defined %}
  18. error_log {{ vhost.error_log }} error;
  19. {% endif %}
  20. {% if vhost.return is defined %}
  21. return {{ vhost.return }};
  22. {% endif %}
  23. {% if vhost.extra_parameters is defined %}
  24. {{ vhost.extra_parameters }}
  25. {% endif %}
  26. }
  27. {% endfor %}