dockercloud-haproxy icon indicating copy to clipboard operation
dockercloud-haproxy copied to clipboard

Basic auth on a single service?

Open wizonesolutions opened this issue 7 years ago • 2 comments

The HTTP_BASIC_AUTH variable only applies at the global level. Is it possible to require authentication for just a specific service without setting it globally and excluding every other service?

wizonesolutions avatar Oct 11 '17 13:10 wizonesolutions

I haven't tested but looking at their docs it says:

Global and default settings of HAProxy HTTP_BASIC_AUTH -> a comma-separated list of credentials(:) for HTTP basic auth, which applies to all the backend routes. To escape comma, use ,. Attention: DO NOT rely on this for authentication in production

Settings in linked application services EXCLUDE_BASIC_AUTH -> if set(any value) and HTTP_BASIC_AUTH global setting is set, no basic auth will be applied to this service.

Given that information I assume you apply HTTP_BASIC_AUTH on all services, but you explicitly remove authentication using EXCLUDE_BASIC_AUTH on each of your service.

roks0n avatar Nov 02 '17 21:11 roks0n

The way @roks0n suggests works perfectly fine, I am using it this way currently. I think this issue can be closed

jontro avatar Feb 21 '18 10:02 jontro