example-vars.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ---
  2. # The user to run nginx
  3. nginx_user: "www-data"
  4. nginx_hhvm: |
  5. add_header X-backend hhvm;
  6. try_files $uri $uri/ /index.php?$args;
  7. location ~ \.(hh|php)$ {
  8. try_files $uri =404;
  9. fastcgi_pass unix:/var/run/hhvm/sock;
  10. fastcgi_index index.php;
  11. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  12. include fastcgi_params;
  13. }
  14. # A list of directives for the events section.
  15. nginx_events_params:
  16. - worker_connections 512
  17. # A list of hashs that define the servers for nginx,
  18. # as with http parameters. Any valid server parameters
  19. # can be defined here.
  20. nginx_http_params:
  21. - sendfile on
  22. - access_log /var/log/nginx/access.log
  23. nginx_sites:
  24. default:
  25. - listen 80
  26. - server_name _
  27. - root "/usr/share/nginx/html"
  28. - index index.html
  29. foo:
  30. - listen 8080
  31. - server_name localhost
  32. - root "/tmp/site1"
  33. - location / { try_files $uri $uri/ /index.html; }
  34. - location /images/ { try_files $uri $uri/ /index.html; }
  35. bar:
  36. - listen 9090
  37. - server_name ansible
  38. - root "/tmp/site2"
  39. - location / { try_files $uri $uri/ /index.html; }
  40. - location /images/ {
  41. try_files $uri $uri/ /index.html;
  42. allow 127.0.0.1;
  43. deny all;
  44. }
  45. - auth_basic "Restricted"
  46. - auth_basic_user_file auth_basic/demo
  47. hhvm_test:
  48. - |
  49. listen 80;
  50. server_name test_hhvm;
  51. root "/tmp/hhvm";
  52. {{nginx_hhvm}}
  53. # A list of hashs that define additional configuration
  54. nginx_configs:
  55. proxy:
  56. - proxy_set_header X-Real-IP $remote_addr
  57. - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
  58. upstream:
  59. - upstream foo { server 127.0.0.1:8080 weight=10; }
  60. geo:
  61. - geo $local {
  62. default 0;
  63. 127.0.0.1 1;
  64. }
  65. gzip:
  66. - gzip on
  67. - gzip_disable msie6
  68. # A list of hashs that define uer/password files
  69. nginx_auth_basic_files:
  70. demo:
  71. - foo:$apr1$mEJqnFmy$zioG2q1iDWvRxbHuNepIh0 # foo:demo , generated by : htpasswd -nb foo demo
  72. - bar:$apr1$H2GihkSo$PwBeV8cVWFFQlnAJtvVCQ. # bar:demo , generated by : htpasswd -nb bar demo