Derek Neely

...notes for thyself, but useful for all...

Apache Proxy Basic Auth to Backend Service

Apr 18, 2017 by derek

We recently needed to deploy a Docker container (Docker registry server) that requires basic auth to the backend service. The standard Apache config for proxying back to the Docker container worked fine for pushing and pulling images and browser based stuff we were doing.

ProxyPass /
ProxyPassReverse /

However, the issue we wound up having was tying in the registry APIs to a little tool kit we run to help visualize and browse the repositories and images we have on our registry. The issue we were having is we were unable to pass through the basic auth needed due to the initial OPTIONS request that is made when sending the Authorization header. So, besides the additional CORS stuff we had to enable in the Apache config we also needed to handle the proxying a little differently.

RewriteEngine  On
RewriteRule /(.*)$1 [P,L]
ProxyPassReverse /

If you have any questions or need help, feel free to ping me on Twitter.

Security, Proxy, Web, Apache


Tweet Tweet Tweet

© 2016 Derek Neely