params.pp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Class: nginx::param
  2. #
  3. # This module manages NGINX paramaters
  4. #
  5. # Parameters:
  6. #
  7. # There are no default parameters for this class.
  8. #
  9. # Actions:
  10. #
  11. # Requires:
  12. #
  13. # Sample Usage:
  14. #
  15. # This class file is not called directly
  16. class nginx::params {
  17. $nx_temp_dir = '/tmp'
  18. $nx_run_dir = '/var/nginx'
  19. $nx_conf_dir = '/etc/nginx'
  20. $nx_confd_purge = false
  21. $nx_worker_processes = 1
  22. $nx_worker_connections = 1024
  23. $nx_multi_accept = off
  24. $nx_events_use = false # One of [kqueue|rtsig|epoll|/dev/poll|select|poll|eventport] or false to use OS default
  25. $nx_sendfile = on
  26. $nx_keepalive_timeout = 65
  27. $nx_tcp_nodelay = on
  28. $nx_gzip = on
  29. $nx_server_tokens = on
  30. $nx_spdy = off
  31. $nx_ssl_stapling = off
  32. $nx_proxy_redirect = off
  33. $nx_proxy_set_header = [
  34. 'Host $host',
  35. 'X-Real-IP $remote_addr',
  36. 'X-Forwarded-For $proxy_add_x_forwarded_for',
  37. ]
  38. $nx_client_body_temp_path = "${nx_run_dir}/client_body_temp"
  39. $nx_client_body_buffer_size = '128k'
  40. $nx_client_max_body_size = '10m'
  41. $nx_proxy_temp_path = "${nx_run_dir}/proxy_temp"
  42. $nx_proxy_connect_timeout = '90'
  43. $nx_proxy_send_timeout = '90'
  44. $nx_proxy_read_timeout = '90'
  45. $nx_proxy_buffers = '32 4k'
  46. $nx_proxy_http_version = '1.0'
  47. $nx_logdir = $::kernel ? {
  48. /(?i-mx:linux)/ => '/var/log/nginx',
  49. }
  50. $nx_pid = $::kernel ? {
  51. /(?i-mx:linux)/ => '/var/run/nginx.pid',
  52. }
  53. $nx_daemon_user = $::operatingsystem ? {
  54. /(?i-mx:debian|ubuntu)/ => 'www-data',
  55. /(?i-mx:fedora|rhel|redhat|centos|scientific|suse|opensuse|amazon)/ => 'nginx',
  56. }
  57. # Service restart after Nginx 0.7.53 could also be just "/path/to/nginx/bin -s HUP"
  58. # Some init scripts do a configtest, some don't. If configtest_enable it's true
  59. # then service restart will take $nx_service_restart value, forcing configtest.
  60. $nx_configtest_enable = false
  61. $nx_service_restart = "/etc/init.d/nginx configtest && /etc/init.d/nginx restart"
  62. $nx_mail = false
  63. }