I have a gitlab omnibus instance hidden behind a reverse proxy. The images uploaded by users have the wrong URL

I'm running GitLab Community Edition 8.11.5 on Ubuntu LTS 14.04 which is "hidden" behind a reverse proxy.

The system images display perfectly fine on all pages, but the images uploaded by users don't resolve to the right address (the reverse proxy's address).

Let's suppose that the URL of my reverse proxy is: https://gitlab.reverse-proxy.domain.com And the URL of my instance is: https://my-gitlab-instance.domain.com.

When displaying a page, I want all the "hrefs" to be pointing to the reverse proxy URL which is: https://gitlab.reverse-proxy.domain.com/ This works well for most of the resources but the images uploaded by users (such as an avatar image for the profile), get hrefs of the type: "https://my-gitlab-instance.domain.com/". Now, since my instance is not accessible unless from the proxy, that naturally generates a NOT FOUND error.

The relevant bits of my gitlab.rb file are:

external_url 'https://my-gitlab-instance.domain.com' nginx['redirect_http_to_https'] = true

nginx['proxy_set_headers'] = { "Host" => "https://gitlab.reverse-proxy.domain.com", "X-Forwarded-Proto" => "https", "X-Forwarded-Ssl" => "on" }

As an example, a correct image is: https://gitlab.reverse-proxy.domain.com/assets/1F44D-59ec2457ab33e889726048071d01a495f6cf5c668d00dc541c3b1be5294b1e61.png

Whereas an incorrect one is: https://my-gitlab-instance.domain.com/uploads/user/avatar/3/avatar.png. Again this URL doesn't work for me because this host is not accessible directly unless via the reverse proxy.

This looks to me like a bug, since most of the images work, except for those uploaded by users (not sure why).