search cancel

Gitbridge unable to handle X-Forwarded Headers


Article ID: 213086


Updated On:


Endevor Software Change Manager (SCM)


Gitbridge seems to be unable to handle X-Forward Headers that allow it to run behind a proxy for ssl offloading and github authentication.
Setting the "ProxyPreserveHost On" corrects the domain name that gitbridge thinks it's running on. However, gitbridge changes the protocol from https, to http.
Further editing the location header to change the response's query to https lets github authenticate, but gitbrige then complains that the JWT token isn't valid. Likely because the protocols don't match what gitbridge originally sent.
Example apache configuration:
<VirtualHost *:80>
RequestHeader set Host
RequestHeader set X-Forwarded-Port 443
RequestHeader set X-Forwarded-Proto https
ProxyPreserveHost On
Header edit Location
ProxyPass / http://ndvr-git-bridge:8081/ disablereuse=On
ProxyPassReverse / http://ndvr-git-bridge:8081/
ProxyPassReverseCookiePath / /


Release : 18.0

Component : BRIDGE FOR GIT 2.6.3


X-Forwarded Headers can be accepted by gitbridge after upgrade to Bridge for Git 2.7.0