Commit 7c3289f7e1eb8a5c381b156825dd9cd80ba27403
1 parent
2f09bc5a
Exists in
master
Give NGINX its own working directory
Showing
3 changed files
with
4 additions
and
0 deletions
Show diff stats
CHANGELOG
@@ -9,6 +9,7 @@ omnibus-gitlab repository. | @@ -9,6 +9,7 @@ omnibus-gitlab repository. | ||
9 | - Log `rake db:migrate` output in /tmp | 9 | - Log `rake db:migrate` output in /tmp |
10 | - Support `issue_closing_pattern` via gitlab.rb (Michael Hill) | 10 | - Support `issue_closing_pattern` via gitlab.rb (Michael Hill) |
11 | - Use SIGHUP for zero-downtime NGINX configuration changes | 11 | - Use SIGHUP for zero-downtime NGINX configuration changes |
12 | +- Give NGINX its own working directory | ||
12 | 13 | ||
13 | 7.2.0 | 14 | 7.2.0 |
14 | - Pass environment variables to Unicorn and Sidekiq (Chris Portman) | 15 | - Pass environment variables to Unicorn and Sidekiq (Chris Portman) |
files/gitlab-cookbooks/gitlab/recipes/nginx.rb
@@ -18,11 +18,13 @@ | @@ -18,11 +18,13 @@ | ||
18 | 18 | ||
19 | nginx_dir = node['gitlab']['nginx']['dir'] | 19 | nginx_dir = node['gitlab']['nginx']['dir'] |
20 | nginx_etc_dir = File.join(nginx_dir, "etc") | 20 | nginx_etc_dir = File.join(nginx_dir, "etc") |
21 | +nginx_working_dir = File.join(nginx_dir, "working") | ||
21 | nginx_log_dir = node['gitlab']['nginx']['log_directory'] | 22 | nginx_log_dir = node['gitlab']['nginx']['log_directory'] |
22 | 23 | ||
23 | [ | 24 | [ |
24 | nginx_dir, | 25 | nginx_dir, |
25 | nginx_etc_dir, | 26 | nginx_etc_dir, |
27 | + nginx_working_dir, | ||
26 | nginx_log_dir, | 28 | nginx_log_dir, |
27 | ].each do |dir_name| | 29 | ].each do |dir_name| |
28 | directory dir_name do | 30 | directory dir_name do |
files/gitlab-cookbooks/gitlab/templates/default/sv-nginx-run.erb
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | exec 2>&1 | 2 | exec 2>&1 |
3 | <%= render("mount_point_check.erb") %> | 3 | <%= render("mount_point_check.erb") %> |
4 | +cd <%= File.join(node['gitlab']['nginx']['dir'], "working") %> | ||
4 | exec chpst -P /opt/gitlab/embedded/sbin/nginx -c <%= File.join(node['gitlab']['nginx']['dir'], "etc", "nginx.conf") %> | 5 | exec chpst -P /opt/gitlab/embedded/sbin/nginx -c <%= File.join(node['gitlab']['nginx']['dir'], "etc", "nginx.conf") %> |