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.

132 lines
5.0KB

  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. repo_version: development # Must be using ppa install by setting `repo_source = ppa`
  9. set_real_ips: # NOTE: to use this, nginx must have http_realip module enabled
  10. from_ips:
  11. - 10.10.10.0/24
  12. real_ip_header: X-Forwarded-For
  13. modules:
  14. headers-more:
  15. source: http://github.com/agentzh/headers-more-nginx-module/tarball/v0.21
  16. source_hash: sha1=dbf914cbf3f7b6cb7e033fa7b7c49e2f8879113b
  17. # ========
  18. # nginx.ng
  19. # ========
  20. nginx:
  21. ng:
  22. # PPA installing
  23. install_from_ppa: True
  24. # Set to 'stable', 'development' (mainline), 'community', or 'nightly' for each build accordingly ( https://launchpad.net/~nginx )
  25. ppa_version: 'stable'
  26. # These are usually set by grains in map.jinja
  27. lookup:
  28. package: nginx-custom
  29. service: nginx
  30. webuser: www-data
  31. conf_file: /etc/nginx/nginx.conf
  32. vhost_available: /etc/nginx/sites-available
  33. vhost_enabled: /etc/nginx/sites-enabled
  34. vhost_use_symlink: True
  35. # This is required for RedHat like distros (Amazon Linux) that don't follow semantic versioning for $releasever
  36. rh_os_releasever: '6'
  37. # Source compilation is not currently a part of nginx.ng
  38. from_source: False
  39. package:
  40. opts: {} # this partially exposes parameters of pkg.installed
  41. service:
  42. enable: True # Whether or not the service will be enabled/running or dead
  43. opts: {} # this partially exposes parameters of service.running / service.dead
  44. server:
  45. opts: {} # this partially exposes file.managed parameters as they relate to the main nginx.conf file
  46. # nginx.conf (main server) declarations
  47. # dictionaries map to blocks {} and lists cause the same declaration to repeat with different values
  48. config:
  49. worker_processes: 4
  50. pid: /run/nginx.pid
  51. events:
  52. worker_connections: 768
  53. http:
  54. sendfile: 'on'
  55. include:
  56. - /etc/nginx/mime.types
  57. - /etc/nginx/conf.d/*.conf
  58. vhosts:
  59. disabled_postfix: .disabled # a postfix appended to files when doing non-symlink disabling
  60. symlink_opts: {} # partially exposes file.symlink params when symlinking enabled sites
  61. rename_opts: {} # partially exposes file.rename params when not symlinking disabled/enabled sites
  62. managed_opts: {} # partially exposes file.managed params for managed vhost files
  63. dir_opts: {} # partially exposes file.directory params for site available/enabled dirs
  64. # vhost declarations
  65. # vhosts will default to being placed in vhost_available
  66. managed:
  67. mysite: # relative pathname of the vhost file
  68. # may be True, False, or None where True is enabled, False, disabled, and None indicates no action
  69. available_dir: /tmp/sites-available # an alternate directory (not sites-available) where this vhost may be found
  70. enabled_dir: /tmp/sites-enabled # an alternate directory (not sites-available) where this vhost may be found
  71. disabled_name: mysite.aint_on # an alternative disabled name to be use when not symlinking
  72. enabled: True
  73. # May be a list of config options or None, if None, no vhost file will be managed/templated
  74. # Take server directives as lists of dictionaries. If the dictionary value is another list of
  75. # dictionaries a block {} will be started with the dictionary key name
  76. config:
  77. - server:
  78. - server_name: localhost
  79. - listen:
  80. - 80
  81. - default_server
  82. - index:
  83. - index.html
  84. - index.htm
  85. - location ~ .htm:
  86. - try_files:
  87. - $uri
  88. - $uri/ =404
  89. - test: something else
  90. # The above outputs:
  91. # server {
  92. # server_name localhost;
  93. # listen 80 default_server;
  94. # index index.html index.htm;
  95. # location ~ .htm {
  96. # try_files $uri $uri/ =404;
  97. # test something else;
  98. # }
  99. # }
  100. # If you're doing SSL termination, you can deploy certificates this way.
  101. # The private one(s) should go in a separate pillar file not in version
  102. # control (or use encrypted pillar data).
  103. certificates:
  104. 'www.example.com':
  105. public_cert: |
  106. -----BEGIN CERTIFICATE-----
  107. (Your Primary SSL certificate: www.example.com.crt)
  108. -----END CERTIFICATE-----
  109. -----BEGIN CERTIFICATE-----
  110. (Your Intermediate certificate: ExampleCA.crt)
  111. -----END CERTIFICATE-----
  112. -----BEGIN CERTIFICATE-----
  113. (Your Root certificate: TrustedRoot.crt)
  114. -----END CERTIFICATE-----
  115. private_key: |
  116. -----BEGIN RSA PRIVATE KEY-----
  117. (Your Private Key: www.example.com.key)
  118. -----END RSA PRIVATE KEY-----