Skip to content

Instantly share code, notes, and snippets.

@RushOnline
Last active April 12, 2018 12:34
Show Gist options
  • Save RushOnline/4a6c756f70228337347c698580658f46 to your computer and use it in GitHub Desktop.
Save RushOnline/4a6c756f70228337347c698580658f46 to your computer and use it in GitHub Desktop.
# include to your server{}
location /sources/ {
allow 192.168.0.0/16; # infrastructure
deny all;
rewrite ^\/sources\/(.*)\/.*?\.(tar\.gz|zip|tar\.bz2|tar)$ /private/$1/archive.$2;
}
location /private/ {
internal;
gzip off;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
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_set_header PRIVATE-TOKEN YOURPRIVATETOKEN_GENERATED_WITH_GITLAB;
proxy_pass http://gitlab/;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment