Saltstack Official Nginx Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.6KB

  1. nginx:
  2. install_from_source: True
  3. use_upstart: True
  4. use_sysvinit: False
  5. user_auth_enabled: True
  6. with_luajit: False
  7. with_openresty: True
  8. set_real_ips: # NOTE: to use this, nginx must have http_realip module enabled
  9. from_ips:
  10. - 10.10.10.0/24
  11. real_ip_header: X-Forwarded-For
  12. modules:
  13. headers-more:
  14. source: http://github.com/agentzh/headers-more-nginx-module/tarball/v0.21
  15. source_hash: sha1=dbf914cbf3f7b6cb7e033fa7b7c49e2f8879113b
  16. # ========
  17. # nginx.ng
  18. # ========
  19. nginx:
  20. ng:
  21. # These are usually set by grains in map.jinja
  22. lookup:
  23. package: nginx-custom
  24. service: nginx
  25. webuser: www-data
  26. conf_file: /etc/nginx/nginx.conf
  27. vhost_available: /etc/nginx/sites-available
  28. vhost_enabled: /etc/nginx/sites-enabled
  29. vhost_use_symlink: True
  30. # Source compilation is not currently a part of nginx.ng
  31. from_source: False
  32. package:
  33. opts: {} # this partially exposes parameters of pkg.installed
  34. service:
  35. enable: True # Whether or not the service will be enabled/running or dead
  36. opts: {} # this partially exposes parameters of service.running / service.dead
  37. server:
  38. opts: {} # this partially exposes file.managed parameters as they relate to the main nginx.conf file
  39. # nginx.conf (main server) declarations
  40. # dictionaries map to blocks {} and lists cause the same declaration to repeat with different values
  41. config:
  42. worker_processes: 4
  43. pid: /run/nginx.pid
  44. events:
  45. worker_connections: 768
  46. http:
  47. sendfile: 'on'
  48. include:
  49. - /etc/nginx/mime.types
  50. - /etc/nginx/conf.d/*.conf
  51. vhosts:
  52. disabled_postfix: .disabled # a postfix appended to files when doing non-symlink disabling
  53. symlink_opts: {} # partially exposes file.symlink params when symlinking enabled sites
  54. rename_opts: {} # partially exposes file.rename params when not symlinking disabled/enabled sites
  55. managed_opts: {} # partially exposes file.managed params for managed vhost files
  56. dir_opts: {} # partially exposes file.directory params for site available/enabled dirs
  57. # vhost declarations
  58. # vhosts will default to being placed in vhost_available
  59. managed:
  60. mysite: # relative pathname of the vhost file
  61. # may be True, False, or None where True is enabled, False, disabled, and None indicates no action
  62. dir: /tmp # an alternate directory (not sites-available) where this vhost may be found
  63. disabled_name: mysite.aint_on # an alternative disabled name to be use when not symlinking
  64. enabled: True
  65. # May be a list of config options or None, if None, no vhost file will be managed/templated
  66. # Take server directives as lists of dictionaries. If the dictionary value is another list of
  67. # dictionaries a block {} will be started with the dictionary key name
  68. config:
  69. - server:
  70. - server_name: localhost
  71. - listen:
  72. - 80
  73. - default_server
  74. - index:
  75. - index.html
  76. - index.htm
  77. - location ~ .htm:
  78. - try_files:
  79. - $uri
  80. - $uri/ =404
  81. - test: something else
  82. # The above outputs:
  83. # server {
  84. # server_name localhost;
  85. # listen 80 default_server;
  86. # index index.html index.htm;
  87. # location ~ .htm {
  88. # try_files $uri $uri/ =404;
  89. # test something else;
  90. # }
  91. # }