How to exclude letsencrypt .wellknown path from Basic Auth

Hello Friends,

I have CentOS 8 server, I have set up letsencrypt Auto-Renew but it is not working as my site is behind the basic Auth.

Can someone guide me on how can I exclude the .wellknown path from basic auth?

Thanks in advance.

I understand you are using CentOS.
Which HTTP web server are you running?

In NGINX, try auth_basic off; statement under location for desired path in NGINX config.

Yes, It is CentOS with Nginx. I will try and update you.

Hi,
This in server block works

auth_basic "This is Stagging Site";
auth_basic_user_file /etc/nginx/.htpasswd;

location ^~ /.well-known/acme-challenge/ {
auth_basic off;
}