mirror of
https://github.com/sameersbn/docker-gitlab.git
synced 2026-01-18 13:58:25 +00:00
nginx: route uploads request through Gitlab (See #266)
This commit is contained in:
parent
a6da9ad916
commit
cd640f6002
@ -57,6 +57,27 @@ server {
|
||||
try_files $uri $uri/index.html $uri.html @gitlab;
|
||||
}
|
||||
|
||||
## We route uploads through GitLab to prevent XSS and enforce access control.
|
||||
location {{GITLAB_RELATIVE_URL_ROOT__with_trailing_slash}}uploads/ {
|
||||
## 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 {{NGINX_X_FORWARDED_PROTO}};
|
||||
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||
|
||||
proxy_pass http://gitlab;
|
||||
}
|
||||
|
||||
## If a file, which is not found in the root folder is requested,
|
||||
## then the proxy passes the request to the upsteam (gitlab unicorn).
|
||||
location @gitlab {
|
||||
|
||||
@ -105,6 +105,28 @@ server {
|
||||
try_files $uri $uri/index.html $uri.html @gitlab;
|
||||
}
|
||||
|
||||
## We route uploads through GitLab to prevent XSS and enforce access control.
|
||||
location {{GITLAB_RELATIVE_URL_ROOT__with_trailing_slash}}uploads/ {
|
||||
## 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 {{NGINX_X_FORWARDED_PROTO}};
|
||||
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||
|
||||
proxy_pass http://gitlab;
|
||||
}
|
||||
|
||||
## If a file, which is not found in the root folder is requested,
|
||||
## then the proxy passes the request to the upsteam (gitlab unicorn).
|
||||
location @gitlab {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user