# yum -y install httpd-tools # htpasswd -c -b /etc/nginx/.htpasswd {username} {password} /etc/nginx/conf.d/default.conf location / { auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd; }