vhosts.j2 813 B

123456789101112131415161718192021222324252627282930313233343536
  1. {% for vhost in nginx_vhosts -%}
  2. server {
  3. listen {{ vhost.listen | default('80 default_server') }};
  4. server_name {{ vhost.server_name }};
  5. {%- if vhost.root is defined -%}
  6. root {{ vhost.root }};
  7. {% endif %}
  8. {%- if vhost.index is defined -%}
  9. index {{ vhost.index }};
  10. {% endif %}
  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 %}