Help: Using Nginx Reverse Proxy bypass traffic in to a application running in a container

Francis Daly francis at
Tue Jun 1 07:06:33 UTC 2021

On Sat, May 29, 2021 at 07:46:40PM +0530, Amila Gunathilaka wrote:

Hi there,

> My concern is why nginx still gives 401 responses *unless *my nginx.conf
> has a basic authentication user name and password file in the
> location /etc/nginx/.htpasswd.
> It says still not authenticate my external client POST requests yet ?   Any
> thoughts?

I'm not sure I understand your question.

"auth_basic" says "for each each request to nginx, if the user/password in
the request does not match something in the file, nginx should return 401"

If you want nginx to do authentication checks, you want auth_basic and
auth_basic_user_file, If you do not want nginx to do authentication checks,
you do not want auth_basic.

(You can use "auth_basic off;" if you want one location{} not to use
auth_basic that would be inherited from a surrounding context.)

If that does not tell you what you want, could you explain again, please?


Francis Daly        francis at

More information about the nginx mailing list