Saltstack Official Nginx Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

33 行
997B

  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 -%}