Oct 11, 2021
0
Level 4
Basic Auth Exception with Nginx
I want to protect my staging site with basic auth which I've managed to do via the Forge CP. I have one URl which needs to be unprotected as we're testing a Stripe integration and want to open that up. I have middleware which will restrict the IP addresses that can operate on that endpoint.
According to sources online, the way to unprotect a uri from basic auth is:
location /unprotected-uri {
auth_basic off;
}
Which I have added to the end of /etc/nginx/forge-conf/staging.mysite.com/server/protected_site-21104.conf. So full file reads as:
auth_basic "Restricted Area";
auth_basic_user_file /etc/nginx/forge-conf/staging.mysite.com/server/.htpasswd-21104;
location /unprotected-uri {
auth_basic off;
}
But when calling this, it still results in "Authorization Required".
Any suggestions?
Please or to participate in this conversation.