Commit f53ed9ba authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'nginx_ip' into 'master'

Nginx ip

Add nginx ip as attribute

See merge request !112
parents c9a05064 ecc0c369
......@@ -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'],
:ssl_certificate_path => gitlab['ssl_certificate_path'],
:ssl_certificate_key_path => gitlab['ssl_certificate_key_path'],
......
......@@ -23,6 +23,7 @@ describe "gitlab::nginx" do
variables: {
path: "/home/git/gitlab",
host: "localhost",
ip: "*",
port: "80",
ssl_certificate_path: "/etc/ssl",
ssl_certificate_key_path: "/etc/ssl",
......@@ -64,6 +65,7 @@ describe "gitlab::nginx" do
variables: {
path: "/data/git/gitlab",
host: "localhost",
ip: "*",
port: "80",
ssl_certificate_path: "/etc/ssl",
ssl_certificate_key_path: "/etc/ssl",
......@@ -111,6 +113,7 @@ describe "gitlab::nginx" do
variables: {
path: "/home/git/gitlab",
host: "localhost",
ip: "*",
port: "80",
ssl_certificate_path: "/etc/ssl",
ssl_certificate_key_path: "/etc/ssl",
......@@ -148,6 +151,7 @@ describe "gitlab::nginx" do
variables: {
path: "/data/git/gitlab",
host: "localhost",
ip: "*",
port: "80",
ssl_certificate_path: "/etc/ssl",
ssl_certificate_key_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