diff --git a/recipes/default.rb b/recipes/default.rb index d455201..de1d3db 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -326,6 +326,7 @@ :fqdn => node['fqdn'], :gitlab_app_home => node['gitlab']['app_home'], :https_boolean => node['gitlab']['https'], + :port => (node['gitlab']['https'] ? 443 : 80), :ssl_certificate => node['gitlab']['ssl_certificate'], :ssl_certificate_key => node['gitlab']['ssl_certificate_key'] ) diff --git a/templates/default/nginx.default.conf.erb b/templates/default/nginx.default.conf.erb index 635b832..d851ee6 100644 --- a/templates/default/nginx.default.conf.erb +++ b/templates/default/nginx.default.conf.erb @@ -7,7 +7,7 @@ upstream gitlab { } server { - listen *:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea + listen *:<%= @port %> default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea # server_name <%= @fqdn %>; # e.g., server_name source.example.com; server_name <%= "git.demarque.com" %>; # e.g., server_name source.example.com; server_tokens off; # don't show the version number, a security best practice