Joxit/docker-registry-ui

Ability to PASS headers via nginx proxy

dominch opened this issue ยท 3 comments

I'm trying to set up ui with nginx proxy and pass basic http authentification via proxy. With that browser should ask for username and password, then send them via proxy. Right now there is ability to set some headers (including some auth data), but I need to read auth data from browser and send those.

In short I need to add proxy_pass_header Authorization line into nginx proxy configuration,

Right now there is no right option to do that, I inspected templates and following is working:

          env:
            - name: NGINX_PROXY_PASS_URL
              value: "https://my-registry.net"
            - name: NGINX_PROXY_HEADER_Host
              value: "my-registry.net"
            - name: NGINX_PROXY_HEADER_Authorization
              value: "$http_authorization"
            - name: NGINX_PROXY_HEADER_Pass
              value: 1\"; proxy_pass_header  \"Authorization

This will add fake header Pass and inject extra configuration instruction. This should not work as it's potential big security issue, but this allowed me to configure missing thing. With that I got what I wanted - passed auth data and working GUI, but I hope to see new env var in future to allow this task.

Joxit commented

Hi, thank you for using my project and your feature request ๐Ÿ˜Š

I added the set of options NGINX_PROXY_PASS_HEARER_* for you, this will be available in 2.1.0 soon and is already available in main/master tags ๐ŸŽ‰

If you are using docker compose, you must set value (empty or not) for the environment (e.g - NGINX_PROXY_PASS_HEARER_Authorization=)

thanks :)
I'll test it on next release :)

Joxit commented

2.1.0 released ! ๐Ÿš€