added seperate server block for http config in gitlab.https.permissive. Fixes #127

This commit is contained in:
Sameer Naik 2014-08-25 20:47:40 +05:30
parent efb421e757
commit 0f5f17275c
2 changed files with 53 additions and 1 deletions

View File

@ -1,6 +1,7 @@
# Changelog
**latest**
- added seperate server block for http config in gitlab.https.permissive. Fixes #127
- added OAUTH_GOOGLE_RESTRICT_DOMAIN config option.
**7.2.0**

View File

@ -60,7 +60,58 @@ upstream gitlab {
}
server {
listen 80;
listen *:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
server_name {{YOUR_SERVER_FQDN}}; # e.g., server_name source.example.com;
server_tokens off; # don't show the version number, a security best practice
root /dev/null;
# Increase this if you want to upload large attachments
# Or if you want to accept large git objects over http
client_max_body_size {{NGINX_MAX_UPLOAD_SIZE}};
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
location {{GITLAB_RELATIVE_URL_ROOT}}/ {
root {{GITLAB_INSTALL_DIR}}/public;
# serve static files from defined root folder;.
# @gitlab is a named location for the upstream fallback, see below
try_files $uri $uri/index.html $uri.html @gitlab;
}
# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @gitlab {
# If you use https make sure you disable gzip compression
# to be safe against BREACH attack
# gzip off;
proxy_read_timeout 300; # Some requests take more than 30 seconds.
proxy_connect_timeout 300; # Some requests take more than 30 seconds.
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://gitlab;
}
# Enable gzip compression as per rails guide: http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression
location ~ ^{{GITLAB_RELATIVE_URL_ROOT}}/assets/(.*) {
alias {{GITLAB_INSTALL_DIR}}/public/assets/$1;
gzip_static on; # to serve pre-gzipped version
expires max;
add_header Cache-Control public;
}
error_page 502 /502.html;
}
server {
listen 443 ssl spdy;
## Replace git.example.com with your FQDN.
server_name {{YOUR_SERVER_FQDN}};