I’m looking to implement a htpasswd prompt on my site.
Following the general lines of this Digital Ocean article currently, but part of the step is to create a file at: /etc/nginx
Therefore for me:
/trellis vagrant ssh cd /etc/nginx
Create the file here, or not? Because when deployed to my hosting, will the file be there or will the provision on production not have the file/wipe out any I create.
I have a need to passwd prompt any page on my site other than the homepage, looking to add:
location = / {
// first location rule and specific using = means it takes priority
// no htpasswd
}
location / {
// catch-all rule for those paths not already matched
// htpasswd
}
@JordanC26 I’m curious if you found a solution. I have a similar need (password-protect a single file), and as you noted above the bedrock-site-protect plugin, while excellent, doesn’t handle targeting specific files/directories.
Unfortunately not @needle, it was a little beyond me creating a custom Trellis role as alwaysblank suggested. Maybe if I had time to focus on it, but I simply went without the password for now.
Yeah however wanted to try see if I could do it on mass, 20+ pages easily and quickly using something like the package above. Defining which pages do/don’t get password protected.