Restricting Access with HTTP Basic Authentication in Apache and Nginx

You can restrict access to your website or some parts of it by implementing a username/password authentication. Usernames and passwords are taken from a file created and populated by a password file creation tool, for example, apache2-utils. Creating a Password File Create additional user-password pairs. Omit the -c flag because the file already exists Nginx configuration location /public/ { auth_basic off; } } Apache/httpd basic configuration <Directory "/var/www/html"> AuthType Basic AuthName "Restricted Content" AuthUserFile /etc/httpd/....

October 12, 2019 · 1 min · 95 words · Akhil Jalagam