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.

61 lines
1.7KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=yaml
  3. ---
  4. # Simple pillar setup
  5. # - remove 'default' site
  6. # - create 'mysite' site
  7. {%- if grains.os_family in ('RedHat',) %}
  8. {%- set passenger_pkg = 'nginx-mod-http-passenger' %}
  9. {%- set passenger_mod = '/usr/lib64/nginx/modules/ngx_http_passenger_module.so' %}
  10. {%- else %}
  11. {%- set passenger_pkg = 'libnginx-mod-http-passenger' %}
  12. {%- set passenger_mod = '/usr/lib/nginx/modules/ngx_http_passenger_module.so' %}
  13. {%- endif %}
  14. nginx:
  15. check_config_before_apply: true
  16. install_from_phusionpassenger: true
  17. lookup:
  18. passenger_package: {{ passenger_pkg }}
  19. server:
  20. config:
  21. # This is required to get the passenger module loaded
  22. # In Debian it can be done with this
  23. # include: 'modules-enabled/*.conf'
  24. load_module: {{ passenger_mod }}
  25. worker_processes: 4
  26. http:
  27. ### module ngx_http_log_module example
  28. log_format: |-
  29. main '$remote_addr - $remote_user [$time_local] $status '
  30. '"$request" $body_bytes_sent "$http_referer" '
  31. '"$http_user_agent" "$http_x_forwarded_for"'
  32. include:
  33. - /etc/nginx/mime.types
  34. - /etc/nginx/conf.d/*.conf
  35. - /etc/nginx/sites-enabled/*
  36. servers:
  37. managed:
  38. default:
  39. deleted: true
  40. enabled: false
  41. config: {}
  42. mysite:
  43. enabled: true
  44. config:
  45. - server:
  46. - passenger_enabled: 'on'
  47. - server_name: localhost
  48. - listen:
  49. - '80 default_server'
  50. - index: 'index.html index.htm'
  51. - location ~ .htm:
  52. - try_files: '$uri $uri/ =404'