I'm having trouble protecting an entire domain with a password prompt. I need to do this with the server (like you can with .htaccess in Apache).
My website is hosted on DigitalOcean servers with the server provisioned by Laravel's Forge. The website itself is a Laravel application.
I have been reading and paying close attention to Matt Stauffer's post on password protecting an entire domain with Laravel Forge. I have followed these steps and I am being asked for a username and password. This is good. However when I enter what should be the correct username and password I am given the "403 Forbidden" Nginx page.
The username and password match the username and password on the .htpasswd file (I have set this file in the public directory of Laravel).
- The post by Matt Stauffer is dated 2014 and I am wondering have the details outlined in the post become outdated or more likely, am I missing something?
- Should the .htpasswd file be in the public directory of a Laravel application or outside of that?
- What is the correct encryption method for setting the password for a user in a .htpasswd file with Nginx v.1.11.9?
Below is a snippet from the current nginx settings:
location / {
try_files $uri $uri/ /index.php?$query_string;
auth_basic "Restricted Area";
auth_basic_user_file /home/forge/sitename.com/.htpasswd;
}
Thanks in advance for any help!
Gavin