Browse Source

Add nginx default file with tweaked ulimit values

Emmanuel Bouthenot 11 years ago
parent
commit
a76a7ebff0
2 changed files with 17 additions and 0 deletions
  1. 6 0
      roles/webserver/tasks/nginx.yml
  2. 11 0
      roles/webserver/templates/nginx/default.j2

+ 6 - 0
roles/webserver/tasks/nginx.yml

@@ -2,6 +2,12 @@
   action: ${ansible_pkg_mgr} pkg=nginx state=installed update_cache=yes
   when_boolean: ${with_nginx}
 
+- name: Install nginx default file configuration
+  action: template src=nginx/default.j2 dest=/etc/default/nginx owner=root group=root mode=0644
+  notify:
+    - Restart nginx
+  when_boolean: ${with_nginx}
+
 - name: Install nginx status configuration
   action: template src=nginx/status.conf.j2 dest=/etc/nginx/conf.d/status.conf owner=root group=root mode=0644
   notify:

+ 11 - 0
roles/webserver/templates/nginx/default.j2

@@ -0,0 +1,11 @@
+{% if ansible_prolog -%}
+{% from 'templates/ansible/prolog.j2' import prolog with context %}
+{{ prolog() }}
+{% endif -%}
+# Note: You may want to look at the following page before setting the ULIMIT.
+#  http://wiki.nginx.org/CoreModule#worker_rlimit_nofile
+# Set the ulimit variable if you need defaults to change.
+#  Example: ULIMIT="-n 4096"
+#ULIMIT="-n 4096"
+ulimit -Hn 65536
+ulimit -Sn 65536