The filenames were confusingly named. read-write.htpasswd did not actually grant read-write access as one might think, only write access. So I renamed these files to read and write to accurately picture what they do.
The sentence "All users in read-only.htpasswd should be in read-write.htpasswd." is incorrect because you never want that, you want the inverse.
Changed mount of read file to ro as well as nginx would never write to it.
Reversed the auth_basic_user_file logic in nginx because there are less read methods than write methods and from security perspective in regards to future HTTP methods, it's better to fail those to the read file than the write file.
Fix multiple issues with this example:
read-write.htpasswd
did not actually grant read-write access as one might think, only write access. So I renamed these files toread
andwrite
to accurately picture what they do.read-only.htpasswd
should be inread-write.htpasswd
." is incorrect because you never want that, you want the inverse.ro
as well as nginx would never write to it.auth_basic_user_file
logic in nginx because there are less read methods than write methods and from security perspective in regards to future HTTP methods, it's better to fail those to the read file than the write file.