Last active
April 12, 2018 12:34
-
-
Save RushOnline/4a6c756f70228337347c698580658f46 to your computer and use it in GitHub Desktop.
Allow download sources from Gitlab with any name https://gitlab.tld/sources/GROUP/PROJECT/repository/master/PROJECT-v0.1.tar.gz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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