I am running gitlab behind a load balancer which is handle my SSL. I have gitlab running as non SSL and the load balancer handlles the https connections. my question is how can I get the path to the repository in the "Activity" section to show https instead of http? The users may be confused when it is showing http but the correct url is https.
I could not find a "perfect" solution, but what I did is, I set the external_url in the gitlab.rb config file to HTTPS and added the following lines to the nginx configuration (/var/opt/gitlab/nginx/conf) manually:
location / {
...
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Url-Scheme https;
...
}
After restarting Gitlab with gitlab-ctl restart everything worked for me. Be aware that with the next gitlab-ctl reconfigure these changes will be lost.
Currently I don't know how to add the required nginx configuration directly to the gitlab.rb configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With