-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[crit] 39#0 *11 open() "/etc/nginx/htpasswd/mydomain.com" failed (13: Permission Denied) #96
Comments
Is the container that you want basic auth using it's own distinct virtual hostname? If so, are you mapping it in the parent directory as Basically, nginx-proxy will look for a file named after the You might want to |
Thanks for the reply. I feel that it's the latter. I am using the -v option as you described. I will attach the bash to it and see how the permissions look on the /etc/nginx/htpasswd file. Thanks! |
I think the issue is that the The "permission denied" error is misleading. |
Hi @md5 In my nginx-proxy container's logs it is actually looking for /etc/nginx/htpasswd/vhost.mydomain.com and subsequently getting a permission denied. Sorry if it wasn't clear but I believe the bind mount is working as intended in that regard; perhaps not carrying over permissions correctly. I'm in the process of spinning up a new instance to investigate with the bash tool. |
Have you tried using Might be nothing, but worth a try |
After investigating within the container I've found that htpasswd does not exist within the /etc/nginx directory. So I will try what you have suggested @thaJeztah. Thanks! |
Still having issues with this. Actually appending the trailing forward slash did not help. When I go to the machine's bash it still shows no htpasswd folder within /etc/nginx. |
Any chance you're using boot2docker and trying to mount a path outside
/Users?
|
@md5 am not using boot2docker. This is actually running on an Ubuntu 14.04 machine. |
Also I noticed that the error goes away if the file mode of the htpasswd file to 0777 (not something I want to do in actuality). |
The Nginx worker processes are running as |
@md5 I have actually tried that. It did not work. More interestingly the SSL certificates are readable by the process. |
I had this problem too. After some attempts I got this working with: # inside the nginx container
chmod -R 0654 /etc/nginx/
chown -R :www-data /etc/nginx/ |
@maxcnunes A better (more restrictive) solution is to change the group of the htpasswd files to In my example I have a single htpasswd file ( The
Verify permissions afterwards:
|
Seems to be an issue migrating from extremely old versions. Resolved by now, closing. |
Hi,
First I'd like to say thank you for a great container. I am having one issue with it though. I have been able to get SSL to work and everything runs smoothly. I am hosting a REST API which works fine without basic authentication, however when I add basic authentication via:
docker run -d -p 80:80 -p 443:443 -v /path/to/certs:/etc/nginx/certs -v /path/to/htpasswdfile:/etc/nginx/htpasswd -v /var/run/docker.sock:/tmp/docker.sock jwilder/nginx-proxy
Everything runs fine. I'm only using basic auth on one container (the rest have built in authentication methods). So when I attempt to access my rest api via firefox (or curl) I get a 500 error. The nginx container log shows the error from the subject line:
[crit] 39#0 *11 open() "/etc/nginx/htpasswd/mydomain.com" failed (13: Permission Denied)
The text was updated successfully, but these errors were encountered: