Gitlab container registry behind nginx proxy

I’m running gitlab behind nginx with letsencrypt certificates and everything looks fine but container registry. TLS termination happens at nginx and I’m not able to login with docker.

I published port 5005:4567 and setup mu config as follows:

registry_external_url 'https://my.gitlab.com:5005'

...
registry_nginx['listen_port'] = 4567
registry_nginx['listen_https'] = false
registry_nginx['proxy_set_headers'] = {
 "Host" => "$http_host",
 "X-Real-IP" => "$remote_addr",
 "X-Forwarded-For" => "$proxy_add_x_forwarded_for",
 "X-Forwarded-Proto" => "https",
 "X-Forwarded-Ssl" => "on"
}

NVM, I just opened the wrong port on the router :pensive: and forgot about it. The configuration works well!

1 Like

Hi, I see that you have registry running behind a ngnix reverse proxy. I’ve been trying to configure this solution for days but I still do not get good results. Could you show me your ngnix configuration for registry?

@ihackalot can you share your nginx configuration. I am struggeling with this issue :confused: I am using the same configuration for the registry in the gitlab config. Are you using the internal nginx or a seperated nginx server?