Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Gitlab - Fixing Unable To Upload Images To Wiki

Whenever I was dragging and dropping an image into the Gitlab window for a Wiki page, I kept getting the following error in the console of Firefox:

Blocked loading mixed active content "http://gitlab.mydomain.com/api/v4/projects/2/wikis/attachments"

It turns out that this was to do with the fact that I was terminating the https connection at the reverse proxy, the encryption wasn't going all the way thorugh to the server. To configure Gitlab to work in this scenario, perform the following steps.

Steps

Edit your gitlab.rb file. For me this was at /mnt/storage/gitlab/config/gitlab.rb

sudo vim /mnt/storage/gitlab/config/gitlab.rb

Uncomment the external_url line and set it to your hostname, making sure to include https://

external_url 'https://gitlab.mydomain.com'

Also find and set

nginx['listen_port'] = 80
nginx['listen_https'] = false

References

Last updated: 6th September 2019
First published: 6th September 2019