2016-04-29 5:48 GMT+02:00 Tuyosi Takesima <nakajin.fu...@gmail.com>: > Hi all . > > i do > chmod 777 /var/www/1/.htpasswd > > and so > nginx works with basic authentification. > > but this setting is too open . > are there any idea ? >
First check the file is owned by the group nginx is running as, probably www. I assume nginx doesn't execute .htpasswd file, so you can drop the execute bit. Only root need to alter the file, so drop write bit for group and other. The data are sensitive, so remove read bit for other. chmod 640 /var/www/1/.htpasswd You can read details on what the number means in the chmod manual. -- Cordialement, Coues Ludovic +336 148 743 42