Commit ecc0c369 authored by Bazoud's avatar Bazoud

Add nginx ip as attribute

parent 7693d12f
......@@ -26,7 +26,7 @@ GRAPH
mysql-chef_gem (>= 0.0.0)
postgresql (>= 1.0.0)
xfs (>= 0.0.0)
gitlab (0.7.1)
gitlab (0.7.2)
apt (>= 0.0.0)
database (>= 0.0.0)
magic_shell (>= 0.0.0)
......
......@@ -62,6 +62,9 @@ else
default['gitlab']['shell_revision'] = "v1.9.7"
end
# Nginx ip
default['gitlab']['ip'] = "*"
# GitLab configuration
default['gitlab']['git_path'] = "/usr/local/bin/git"
default['gitlab']['host'] = "localhost"
......
......@@ -19,6 +19,7 @@ template path do
variables({
:path => gitlab['path'],
:host => gitlab['host'],
:ip => gitlab['ip'],
:port => gitlab['port'],
:url => gitlab['url'],
:ssl_certificate_path => gitlab['ssl_certificate_path'],
......
......@@ -23,6 +23,7 @@ describe "gitlab::nginx" do
variables: {
path: "/home/git/gitlab",
host: "localhost",
ip: "*",
port: "80",
url: "http://localhost:80/",
ssl_certificate_path: "/etc/ssl",
......@@ -65,6 +66,7 @@ describe "gitlab::nginx" do
variables: {
path: "/data/git/gitlab",
host: "localhost",
ip: "*",
port: "80",
url: "http://localhost:80/",
ssl_certificate_path: "/etc/ssl",
......@@ -113,6 +115,7 @@ describe "gitlab::nginx" do
variables: {
path: "/home/git/gitlab",
host: "localhost",
ip: "*",
port: "80",
url: "http://localhost:80/",
ssl_certificate_path: "/etc/ssl",
......@@ -151,6 +154,7 @@ describe "gitlab::nginx" do
variables: {
path: "/data/git/gitlab",
host: "localhost",
ip: "*",
port: "80",
url: "http://localhost:80/",
ssl_certificate_path: "/etc/ssl",
......
......@@ -21,7 +21,7 @@ upstream gitlab {
<% if @port == '443' %>
server {
listen *:80;
listen <%= @ip %>:80;
server_name <%= @host %>;
server_tokens off;
return 301 https://<%= @host %>$request_uri;
......@@ -29,7 +29,7 @@ server {
<% end %>
server {
listen *:<%= @port %>;
listen <%= @ip %>:<%= @port %>;
server_name <%= @host %>;
server_tokens off; # don't show the version number, a security best practice
root <%= @path %>/public;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment