Best practice for password protecting staging server

Hey guys, just another quick question for ya’ll.

Just wondering what is the easiest and most strait forwards way of password protecting a bedrock site on a production trellis server. I want something akin if not identical to what you would expect to happen when you try accessing a site with .htpasswd configured. I’m assuming there are some slight differences with a nginx server?

Thanks!

Nginx has basic auth just like Apache. There’s tons of guides online for setting it up.

You’d probably have to add/customize a Trellis role to set up the user/passwords. Then use our Nginx includes feature to add in custom configuration to your WP site to set it.

1 Like

Alright thanks for the quick response

You could use bedrock-site-protect.

3 Likes

@louim released version 1.2.0 yesterday.

bedrock-site-protect now properly supports storing htpasswd credentials in vault.yml, neat!

1 Like