Skip to content

Commit

Permalink
Merge pull request jdauphant#50 from NBZ4live/fix_pid_in_config
Browse files Browse the repository at this point in the history
Make the pid directive configurable
  • Loading branch information
jdauphant committed May 18, 2015
2 parents f771570 + 4430230 commit 5093bda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ nginx_conf_dir: "/etc/nginx"
nginx_user: "{% if ansible_os_family == 'RedHat' %}nginx{% elif ansible_os_family == 'Debian' %}www-data{% endif %}"
nginx_group: "{{nginx_user}}"

nginx_pid_file: '/var/run/{{nginx_service_name}}.pid'

nginx_worker_processes: "{{ ansible_processor_vcpus }}"
nginx_max_clients: 512
nginx_worker_rlimit_nofile: 1024
Expand Down
6 changes: 5 additions & 1 deletion templates/nginx.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
user {{ nginx_user }} {{ nginx_group }};

worker_processes {{ nginx_worker_processes }};
pid /var/run/nginx.pid;

{% if nginx_pid_file %}
pid {{ nginx_pid_file }};
{% endif %}

worker_rlimit_nofile {{ nginx_worker_rlimit_nofile }};

events {
Expand Down

0 comments on commit 5093bda

Please sign in to comment.