Month: August 2025

nginx: making basic auth useful

basic auth doesn’t get the love it deserves. sure, it’s not as fancy as other authentication models out there, it’s basic auth, after all. but if you want to stand up some fast authentication to limit your staging site to the dev team or restrict api access to a few users, basic auth is a good choice. best of all, we can implement the whole thing in nginx so we don’t have to modify our site or api’s authentication.

in this article, we’ll be going over setting up basic auth in nginx and getting it to do useful, practical things like restrict by specific url locations, set access by username, design a way to assign roles to users, and pass usernames into our site’s code.

basic auth is so adequate for fast ad-hoc authentication right now
Continue reading →