Support – Knowledge Base

Protect your Magento store with a password in Nginx

Hypernode makes use of Nginx. Nginx does not use .htaccess files like Apache does. This means that configuration now has to be done in a different format, explained in the Nginx documentation. To protect a directory with a password in Nginx, you can use the same htpasswd file that is used with Apache. To restrict access to a location, you can use the auth basic directive.

Restricting access to a directory

To restrict access to the preview-directory using users and passwords specified in the file /data/web/htpasswd, create a file called server.basicauth in /data/web/nginx containing: