Dependency proxy behind http proxy returns 500

The attempt to pull image via dependency proxy returns code 500.

The gitlab instance in docker can access internet via http_proxy. The docker daemon has http_proxy set, and the container itself also has set env vars http_proxy and https_proxy.
However in gitlab_rails/production_json.log I can see the connection do is rejected.

It is trying to access directly the, ignoring http_proxy.

Is there a way to configure dependency_proxy to use http-proxy for outgoing connections?

I will try this Setting custom environment variables | GitLab