Commit ba807f1e77e8485c7d2e4ac8cbb550b7801b4b78

Authored by Marco Wessel
1 parent 74dcbdb0

Add parameter to tell nginx what IP address to bind on, default *

files/gitlab-cookbooks/gitlab/attributes/default.rb
@@ -50,6 +50,7 @@ default['gitlab']['gitlab-rails']['rate_limit_period'] = 60 @@ -50,6 +50,7 @@ default['gitlab']['gitlab-rails']['rate_limit_period'] = 60
50 50
51 default['gitlab']['gitlab-rails']['gitlab_host'] = node['fqdn'] 51 default['gitlab']['gitlab-rails']['gitlab_host'] = node['fqdn']
52 default['gitlab']['gitlab-rails']['gitlab_port'] = 80 52 default['gitlab']['gitlab-rails']['gitlab_port'] = 80
  53 +default['gitlab']['gitlab-rails']['gitlab_addr'] = '*'
53 default['gitlab']['gitlab-rails']['gitlab_https'] = false 54 default['gitlab']['gitlab-rails']['gitlab_https'] = false
54 default['gitlab']['gitlab-rails']['gitlab_email_from'] = "gitlab@#{node['fqdn']}" 55 default['gitlab']['gitlab-rails']['gitlab_email_from'] = "gitlab@#{node['fqdn']}"
55 default['gitlab']['gitlab-rails']['gitlab_support_email'] = "support@localhost" 56 default['gitlab']['gitlab-rails']['gitlab_support_email'] = "support@localhost"
files/gitlab-cookbooks/gitlab/recipes/nginx.rb
@@ -48,6 +48,7 @@ template nginx_vars[:gitlab_http_config] do @@ -48,6 +48,7 @@ template nginx_vars[:gitlab_http_config] do
48 :https => node['gitlab']['gitlab-rails']['gitlab_https'], 48 :https => node['gitlab']['gitlab-rails']['gitlab_https'],
49 :socket => node['gitlab']['unicorn']['socket'], 49 :socket => node['gitlab']['unicorn']['socket'],
50 :port => node['gitlab']['gitlab-rails']['gitlab_port'], 50 :port => node['gitlab']['gitlab-rails']['gitlab_port'],
  51 + :bind_address => node['gitlab']['gitlab-rails']['gitlab_addr'],
51 :redirect_http_to_https => node['gitlab']['nginx']['redirect_http_to_https'], 52 :redirect_http_to_https => node['gitlab']['nginx']['redirect_http_to_https'],
52 :redirect_http_to_https_port => node['gitlab']['nginx']['redirect_http_to_https_port'], 53 :redirect_http_to_https_port => node['gitlab']['nginx']['redirect_http_to_https_port'],
53 :ssl_certificate => node['gitlab']['nginx']['ssl_certificate'], 54 :ssl_certificate => node['gitlab']['nginx']['ssl_certificate'],
files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb
@@ -21,7 +21,7 @@ upstream gitlab { @@ -21,7 +21,7 @@ upstream gitlab {
21 21
22 <% if @https && @redirect_http_to_https %> 22 <% if @https && @redirect_http_to_https %>
23 server { 23 server {
24 - listen *:<%= @redirect_http_to_https_port %>; 24 + listen <%= @bind_address %>:<%= @redirect_http_to_https_port %>;
25 server_name <%= @fqdn %>; 25 server_name <%= @fqdn %>;
26 server_tokens off; 26 server_tokens off;
27 return 301 https://<%= @fqdn %>:<%= @port %>$request_uri; 27 return 301 https://<%= @fqdn %>:<%= @port %>$request_uri;
@@ -29,7 +29,7 @@ server { @@ -29,7 +29,7 @@ server {
29 <% end %> 29 <% end %>
30 30
31 server { 31 server {
32 - listen *:<%= @port %>; 32 + listen <%= @bind_address %>:<%= @port %>;
33 server_name <%= @fqdn %>; 33 server_name <%= @fqdn %>;
34 server_tokens off; # don't show the version number, a security best practice 34 server_tokens off; # don't show the version number, a security best practice
35 root /opt/gitlab/embedded/service/gitlab-rails/public; 35 root /opt/gitlab/embedded/service/gitlab-rails/public;