params.pp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_logdir = $::kernel ? {
  47. /(?i-mx:linux)/ => '/var/log/nginx',
  48. }
  49. $nx_pid = $::kernel ? {
  50. /(?i-mx:linux)/ => '/var/run/nginx.pid',
  51. }
  52. $nx_daemon_user = $::operatingsystem ? {
  53. /(?i-mx:debian|ubuntu)/ => 'www-data',
  54. /(?i-mx:fedora|rhel|redhat|centos|scientific|suse|opensuse|amazon)/ => 'nginx',
  55. }
  56. # Service restart after Nginx 0.7.53 could also be just "/path/to/nginx/bin -s HUP"
  57. # Some init scripts do a configtest, some don't. If configtest_enable it's true
  58. # then service restart will take $nx_service_restart value, forcing configtest.
  59. $nx_configtest_enable = false
  60. $nx_service_restart = "/etc/init.d/nginx configtest && /etc/init.d/nginx restart"
  61. $nx_mail = false
  62. }