Saltstack Official Nginx Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

nginx.conf 997B

1234567891011121314151617181920212223242526272829303132
  1. {% set indent_increment = 4 %}
  2. {%- macro nginx_block(value, key=None, operator=' ', delim=';', ind=0) -%}
  3. {%- if value != None -%}
  4. {%- if value is number or value is string -%}
  5. {{ key|indent(ind, True) }}{{ operator }}{{ value }}{{ delim }}
  6. {%- elif value is mapping -%}
  7. {{ key|indent(ind, True) }}{{ operator }}{{ '{' }}
  8. {%- for k, v in value.items() %}
  9. {{ nginx_block(v, k, operator, delim, (ind + indent_increment)) }}
  10. {%- endfor %}
  11. {{ '}'|indent(ind, True) }}
  12. {%- elif value is iterable -%}
  13. {%- for v in value %}
  14. {{ nginx_block(v, key, operator, delim, ind) }}
  15. {%- endfor -%}
  16. {%- else -%}
  17. {{ key|indent(ind, True) }}{{ operator }}{{ value }}{{ delim }}
  18. {%- endif -%}
  19. {%- else -%}
  20. {%- endif -%}
  21. {%- endmacro -%}
  22. # Default nginx server configuration
  23. #
  24. # **** DO NOT EDIT THIS FILE ****
  25. #
  26. # This file is managed by Salt.
  27. {% for key, value in config.items() %}
  28. {{ nginx_block(value, key) }}
  29. {%- endfor -%}