Skip to content

Instantly share code, notes, and snippets.

@int128
Last active October 7, 2016 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save int128/49af2eb1b358872819be7fff92264880 to your computer and use it in GitHub Desktop.
Save int128/49af2eb1b358872819be7fff92264880 to your computer and use it in GitHub Desktop.
Nginx redirect config for collaborate GitBucket and Jenkins with GitHub plugin
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