Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
eb210f4a
Commit
eb210f4a
authored
Feb 20, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify nginx config to let /uploads go through to unicorn.
parent
6b0199ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
37 deletions
+47
-37
lib/support/nginx/gitlab
lib/support/nginx/gitlab
+23
-18
lib/support/nginx/gitlab-ssl
lib/support/nginx/gitlab-ssl
+24
-19
No files found.
lib/support/nginx/gitlab
View file @
eb210f4a
## GitLab
## GitLab
## Contributors: randx, yin8086, sashkab, orkoden, axilleas, bbodenmiller
## Contributors: randx, yin8086, sashkab, orkoden, axilleas, bbodenmiller
, DouweM
##
##
## Lines starting with two hashes (##) are comments with information.
## Lines starting with two hashes (##) are comments with information.
## Lines starting with one hash (#) are configuration parameters that can be uncommented.
## Lines starting with one hash (#) are configuration parameters that can be uncommented.
...
@@ -50,31 +50,36 @@ server {
...
@@ -50,31 +50,36 @@ server {
access_log /var/log/nginx/gitlab_access.log;
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
error_log /var/log/nginx/gitlab_error.log;
## If you use HTTPS make sure you disable gzip compression
## to be safe against BREACH attack.
# gzip off;
## https://github.com/gitlabhq/gitlabhq/issues/694
## Some requests take more than 30 seconds.
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
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-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
location / {
location / {
## Serve static files from defined root folder.
## Serve static files from defined root folder.
## @gitlab is a named location for the upstream fallback, see below.
## @gitlab is a named location for the upstream fallback, see below.
try_files $uri $uri/index.html $uri.html @gitlab;
try_files $uri $uri/index.html $uri.html @gitlab;
}
}
## We route uploads through GitLab to prevent XSS and enforce access control.
location /uploads/ {
proxy_pass http://gitlab;
}
## If a file, which is not found in the root folder is requested,
## If a file, which is not found in the root folder is requested,
## then the proxy passes the request to the upsteam (gitlab unicorn).
## then the proxy passes the request to the upsteam (gitlab unicorn).
location @gitlab {
location @gitlab {
## If you use HTTPS make sure you disable gzip compression
## to be safe against BREACH attack.
# gzip off;
## https://github.com/gitlabhq/gitlabhq/issues/694
## Some requests take more than 30 seconds.
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
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-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://gitlab;
proxy_pass http://gitlab;
}
}
...
@@ -84,7 +89,7 @@ server {
...
@@ -84,7 +89,7 @@ server {
## See config/application.rb under "Relative url support" for the list of
## See config/application.rb under "Relative url support" for the list of
## other files that need to be changed for relative url support
## other files that need to be changed for relative url support
location ~ ^/(assets)/ {
location ~ ^/(assets)/ {
root /home/git/gitlab/public
;
gzip on
;
gzip_static on; # to serve pre-gzipped version
gzip_static on; # to serve pre-gzipped version
expires max;
expires max;
add_header Cache-Control public;
add_header Cache-Control public;
...
...
lib/support/nginx/gitlab-ssl
View file @
eb210f4a
## GitLab
## GitLab
## Contributors: randx, yin8086, sashkab, orkoden, axilleas, bbodenmiller
## Contributors: randx, yin8086, sashkab, orkoden, axilleas, bbodenmiller
, DouweM
##
##
## Modified from nginx http version
## Modified from nginx http version
## Modified from http://blog.phusion.nl/2012/04/21/tutorial-setting-up-gitlab-on-debian-6/
## Modified from http://blog.phusion.nl/2012/04/21/tutorial-setting-up-gitlab-on-debian-6/
...
@@ -94,6 +94,23 @@ server {
...
@@ -94,6 +94,23 @@ server {
## Individual nginx logs for this GitLab vhost
## Individual nginx logs for this GitLab vhost
access_log /var/log/nginx/gitlab_access.log;
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
error_log /var/log/nginx/gitlab_error.log;
## If you use HTTPS make sure you disable gzip compression
## to be safe against BREACH attack.
gzip off;
## https://github.com/gitlabhq/gitlabhq/issues/694
## Some requests take more than 30 seconds.
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
location / {
location / {
## Serve static files from defined root folder.
## Serve static files from defined root folder.
...
@@ -101,26 +118,14 @@ server {
...
@@ -101,26 +118,14 @@ server {
try_files $uri $uri/index.html $uri.html @gitlab;
try_files $uri $uri/index.html $uri.html @gitlab;
}
}
## We route uploads through GitLab to prevent XSS and enforce access control.
location /uploads/ {
proxy_pass http://gitlab;
}
## If a file, which is not found in the root folder is requested,
## If a file, which is not found in the root folder is requested,
## then the proxy passes the request to the upsteam (gitlab unicorn).
## then the proxy passes the request to the upsteam (gitlab unicorn).
location @gitlab {
location @gitlab {
## If you use HTTPS make sure you disable gzip compression
## to be safe against BREACH attack.
gzip off;
## https://github.com/gitlabhq/gitlabhq/issues/694
## Some requests take more than 30 seconds.
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://gitlab;
proxy_pass http://gitlab;
}
}
...
@@ -130,7 +135,7 @@ server {
...
@@ -130,7 +135,7 @@ server {
## See config/application.rb under "Relative url support" for the list of
## See config/application.rb under "Relative url support" for the list of
## other files that need to be changed for relative url support
## other files that need to be changed for relative url support
location ~ ^/(assets)/ {
location ~ ^/(assets)/ {
root /home/git/gitlab/public
;
gzip on
;
gzip_static on; # to serve pre-gzipped version
gzip_static on; # to serve pre-gzipped version
expires max;
expires max;
add_header Cache-Control public;
add_header Cache-Control public;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment