Saltstack Official Nginx Formula
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

map.jinja 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {% macro sls_block(dict) %}
  2. {% for key, value in dict.items() %}
  3. - {{ key }}: {{ value|json() }}
  4. {% endfor %}
  5. {% endmacro %}
  6. {% set nginx = salt['pillar.get']('nginx:ng', {
  7. 'lookup': salt['grains.filter_by']({
  8. 'Debian': {
  9. 'package': 'nginx',
  10. 'service': 'nginx',
  11. 'webuser': 'www-data',
  12. 'conf_file': '/etc/nginx/nginx.conf',
  13. 'vhost_available': '/etc/nginx/sites-available',
  14. 'vhost_enabled': '/etc/nginx/sites-enabled',
  15. 'vhost_use_symlink': True,
  16. },
  17. 'RedHat': {
  18. 'package': 'nginx',
  19. 'service': 'nginx',
  20. 'webuser': 'httpd',
  21. 'conf_file': '/etc/nginx/nginx.conf',
  22. 'vhost_available': '/etc/nginx/conf.d',
  23. 'vhost_enabled': '/etc/nginx/conf.d',
  24. 'vhost_use_symlink': False,
  25. },
  26. }, default='Debian' ),
  27. 'install_from_source': False,
  28. 'install_from_ppa': False,
  29. 'package': {
  30. 'opts': {},
  31. },
  32. 'service': {
  33. 'enable': True,
  34. 'opts': {},
  35. },
  36. 'server': {
  37. 'opts': {},
  38. 'config': {
  39. 'worker_processes': 4,
  40. 'pid': '/run/nginx.pid',
  41. 'events': {
  42. 'worker_connections': 768,
  43. },
  44. 'http': {
  45. 'sendfile': 'on',
  46. 'tcp_nopush': 'on',
  47. 'tcp_nodelay': 'on',
  48. 'keepalive_timeout': '65',
  49. 'types_hash_max_size': '2048',
  50. 'default_type': 'application/octet-stream',
  51. 'access_log': '/var/log/nginx/access.log',
  52. 'error_log': '/var/log/nginx/error.log',
  53. 'gzip': 'off',
  54. 'gzip_disable': '"msie6"',
  55. 'include': [
  56. '/etc/nginx/mime.types',
  57. '/etc/nginx/conf.d/*.conf',
  58. '/etc/nginx/sites-enabled/*',
  59. ],
  60. },
  61. },
  62. },
  63. 'vhosts': {
  64. 'disabled_postfix': '.disabled',
  65. 'symlink_opts': {},
  66. 'rename_opts': {},
  67. 'managed_opts': {},
  68. 'dir_opts': {
  69. 'makedirs': True,
  70. },
  71. 'managed': {},
  72. },
  73. }, merge=True) %}
  74. {% if 'user' not in nginx.server.config %}
  75. {% do nginx.server.config.update({
  76. 'user': nginx.lookup.webuser,
  77. })%}
  78. {% endif %}