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 50  
51 51 default['gitlab']['gitlab-rails']['gitlab_host'] = node['fqdn']
52 52 default['gitlab']['gitlab-rails']['gitlab_port'] = 80
  53 +default['gitlab']['gitlab-rails']['gitlab_addr'] = '*'
53 54 default['gitlab']['gitlab-rails']['gitlab_https'] = false
54 55 default['gitlab']['gitlab-rails']['gitlab_email_from'] = "gitlab@#{node['fqdn']}"
55 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 48 :https => node['gitlab']['gitlab-rails']['gitlab_https'],
49 49 :socket => node['gitlab']['unicorn']['socket'],
50 50 :port => node['gitlab']['gitlab-rails']['gitlab_port'],
  51 + :bind_address => node['gitlab']['gitlab-rails']['gitlab_addr'],
51 52 :redirect_http_to_https => node['gitlab']['nginx']['redirect_http_to_https'],
52 53 :redirect_http_to_https_port => node['gitlab']['nginx']['redirect_http_to_https_port'],
53 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 21  
22 22 <% if @https && @redirect_http_to_https %>
23 23 server {
24   - listen *:<%= @redirect_http_to_https_port %>;
  24 + listen <%= @bind_address %>:<%= @redirect_http_to_https_port %>;
25 25 server_name <%= @fqdn %>;
26 26 server_tokens off;
27 27 return 301 https://<%= @fqdn %>:<%= @port %>$request_uri;
... ... @@ -29,7 +29,7 @@ server {
29 29 <% end %>
30 30  
31 31 server {
32   - listen *:<%= @port %>;
  32 + listen <%= @bind_address %>:<%= @port %>;
33 33 server_name <%= @fqdn %>;
34 34 server_tokens off; # don't show the version number, a security best practice
35 35 root /opt/gitlab/embedded/service/gitlab-rails/public;
... ...