diff --git a/files/gitlab-cookbooks/gitlab/attributes/default.rb b/files/gitlab-cookbooks/gitlab/attributes/default.rb index d7062da..1739f29 100644 --- a/files/gitlab-cookbooks/gitlab/attributes/default.rb +++ b/files/gitlab-cookbooks/gitlab/attributes/default.rb @@ -50,6 +50,7 @@ default['gitlab']['gitlab-rails']['rate_limit_period'] = 60 default['gitlab']['gitlab-rails']['gitlab_host'] = node['fqdn'] default['gitlab']['gitlab-rails']['gitlab_port'] = 80 +default['gitlab']['gitlab-rails']['gitlab_addr'] = '*' default['gitlab']['gitlab-rails']['gitlab_https'] = false default['gitlab']['gitlab-rails']['gitlab_email_from'] = "gitlab@#{node['fqdn']}" default['gitlab']['gitlab-rails']['gitlab_support_email'] = "support@localhost" diff --git a/files/gitlab-cookbooks/gitlab/recipes/nginx.rb b/files/gitlab-cookbooks/gitlab/recipes/nginx.rb index 42c1e70..d0da689 100644 --- a/files/gitlab-cookbooks/gitlab/recipes/nginx.rb +++ b/files/gitlab-cookbooks/gitlab/recipes/nginx.rb @@ -48,6 +48,7 @@ template nginx_vars[:gitlab_http_config] do :https => node['gitlab']['gitlab-rails']['gitlab_https'], :socket => node['gitlab']['unicorn']['socket'], :port => node['gitlab']['gitlab-rails']['gitlab_port'], + :bind_address => node['gitlab']['gitlab-rails']['gitlab_addr'], :redirect_http_to_https => node['gitlab']['nginx']['redirect_http_to_https'], :redirect_http_to_https_port => node['gitlab']['nginx']['redirect_http_to_https_port'], :ssl_certificate => node['gitlab']['nginx']['ssl_certificate'], diff --git a/files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb b/files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb index d2635aa..dbe8ccc 100644 --- a/files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb +++ b/files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb @@ -21,7 +21,7 @@ upstream gitlab { <% if @https && @redirect_http_to_https %> server { - listen *:<%= @redirect_http_to_https_port %>; + listen <%= @bind_address %>:<%= @redirect_http_to_https_port %>; server_name <%= @fqdn %>; server_tokens off; return 301 https://<%= @fqdn %>:<%= @port %>$request_uri; @@ -29,7 +29,7 @@ server { <% end %> server { - listen *:<%= @port %>; + listen <%= @bind_address %>:<%= @port %>; server_name <%= @fqdn %>; server_tokens off; # don't show the version number, a security best practice root /opt/gitlab/embedded/service/gitlab-rails/public; -- libgit2 0.21.2