Last active
October 7, 2016 10:50
-
-
Save int128/49af2eb1b358872819be7fff92264880 to your computer and use it in GitHub Desktop.
Nginx redirect config for collaborate GitBucket and Jenkins with GitHub plugin
This file contains 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
server { | |
listen 80; | |
server_name git.example.org; | |
location ~ ^/[^/]+/[^/]+\.git.*$ { | |
return https://git.example.org/git$request_uri; | |
} | |
location ~ ^/api/v3/users/(.*)$ { | |
try_files $uri /api/v3/orgs/$1; | |
} | |
location / { | |
proxy_pass http://gitbucket:8080; | |
client_max_body_size 10M; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; | |
proxy_set_header X-Forwarded-Host $host:$http_x_forwarded_port; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header X-Forwarded-For $http_x_forwarded_for; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment