Securing Your Magento Store Admin with HTTP Basic Auth on Nginx

Make sure to install apache2-utils in your Ubuntu Server. $ sudo apt-get install apache2-utils Then set user and password for HTTP Basic Auth $ htpasswd -c /var/www/.htpasswd username Open your nginx conf file and insert following location ~* ^/(index.php/)?admin { auth_basic “Restricted”; auth_basic_user_file /var/www/.htpasswd; location ~* .(php) { include fastcgi_params; } try_files $uri $uri/ /index.php?$args; […]