Commit a3b5b33a349d98a3e4ea7eedf8a7ee0fbac3d216

Authored by Jacob Vosmaer
1 parent 7c3289f7
Exists in master

Use the default NGINX directory layout

This puts the *_temp directories in /var/opt/gitlab/nginx instead of
/opt/gitlab/embedded (ugh), and uses more default paths to look for
configuration files (configuration in conf/ for instance).
@@ -10,6 +10,7 @@ omnibus-gitlab repository. @@ -10,6 +10,7 @@ omnibus-gitlab repository.
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 - Give NGINX its own working directory
  13 +- Use the default NGINX directory layout
13 14
14 7.2.0 15 7.2.0
15 - Pass environment variables to Unicorn and Sidekiq (Chris Portman) 16 - Pass environment variables to Unicorn and Sidekiq (Chris Portman)
files/gitlab-cookbooks/gitlab/recipes/nginx.rb
@@ -17,14 +17,12 @@ @@ -17,14 +17,12 @@
17 # 17 #
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")  
21 -nginx_working_dir = File.join(nginx_dir, "working") 20 +nginx_conf_dir = File.join(nginx_dir, "conf")
22 nginx_log_dir = node['gitlab']['nginx']['log_directory'] 21 nginx_log_dir = node['gitlab']['nginx']['log_directory']
23 22
24 [ 23 [
25 nginx_dir, 24 nginx_dir,
26 - nginx_etc_dir,  
27 - nginx_working_dir, 25 + nginx_conf_dir,
28 nginx_log_dir, 26 nginx_log_dir,
29 ].each do |dir_name| 27 ].each do |dir_name|
30 directory dir_name do 28 directory dir_name do
@@ -34,9 +32,9 @@ nginx_log_dir = node['gitlab']['nginx']['log_directory'] @@ -34,9 +32,9 @@ nginx_log_dir = node['gitlab']['nginx']['log_directory']
34 end 32 end
35 end 33 end
36 34
37 -nginx_config = File.join(nginx_etc_dir, "nginx.conf") 35 +nginx_config = File.join(nginx_conf_dir, "nginx.conf")
38 nginx_vars = node['gitlab']['nginx'].to_hash.merge({ 36 nginx_vars = node['gitlab']['nginx'].to_hash.merge({
39 - :gitlab_http_config => File.join(nginx_etc_dir, "gitlab-http.conf"), 37 + :gitlab_http_config => File.join(nginx_conf_dir, "gitlab-http.conf")
40 }) 38 })
41 39
42 template nginx_vars[:gitlab_http_config] do 40 template nginx_vars[:gitlab_http_config] do
files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb
@@ -4,8 +4,7 @@ @@ -4,8 +4,7 @@
4 4
5 user <%= node['gitlab']['web-server']['username'] %> <%= node['gitlab']['web-server']['username']%>; 5 user <%= node['gitlab']['web-server']['username'] %> <%= node['gitlab']['web-server']['username']%>;
6 worker_processes <%= @worker_processes %>; 6 worker_processes <%= @worker_processes %>;
7 -error_log /var/log/gitlab/nginx/error.log;  
8 -pid /var/opt/gitlab/nginx/nginx.pid; 7 +error_log stderr;
9 8
10 daemon off; 9 daemon off;
11 10
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") %>  
5 -exec chpst -P /opt/gitlab/embedded/sbin/nginx -c <%= File.join(node['gitlab']['nginx']['dir'], "etc", "nginx.conf") %> 4 +cd <%= node['gitlab']['nginx']['dir'] %>
  5 +exec chpst -P /opt/gitlab/embedded/sbin/nginx -p <%= node['gitlab']['nginx']['dir'] %>