Skip to content
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

nginx_proxy failed (21: Is a directory) #923

Closed
agustinvinao opened this issue Sep 10, 2017 · 3 comments
Closed

nginx_proxy failed (21: Is a directory) #923

agustinvinao opened this issue Sep 10, 2017 · 3 comments

Comments

@agustinvinao
Copy link

I'm trying to override the .conf file for a subdomain (I've tried to do it with the domain too) and when I try to run my container I see this

proxy_1     | nginx.1    | 2017/09/10 20:38:16 [crit] 27#27: pread() "/etc/nginx/conf.d/demo.getdairyfarms.com.conf" failed (21: Is a directory)
proxy_1     | nginx.1    | nginx: [crit] pread() "/etc/nginx/conf.d/demo.getdairyfarms.com.conf" failed (21: Is a directory)

when my volumes are these:

    volumes:
      - "/var/run/docker.sock:/tmp/docker.sock"
      - app-public:/usr/share/nginx/html/dairyfarms/
      - "./containers/production/demo_getdairyfarms_com.conf:/etc/nginx/conf.d/demo.getdairyfarms.com.conf:ro"

Im not sending two files with the same name. Any idea?

@MaksimKlepikov
Copy link

MaksimKlepikov commented Oct 19, 2017

I have same issue. I resolve it by creating volume and putting my_proxy.conf to this volume

docker volume create nginx-conf
cp -R nginx-conf /var/lib/docker/volumes/nginx-conf/_data
docker run -dit -p 80:80 --name nginx-proxy -v /conf.d/my_proxy.conf:/etc/nginx/conf.d -v /var/run/docker.sock:/tmp/docker.sock jwilder/nginx-proxy

in nginx-conf dir i have my_proxy.conf

I think in my case this is all because the folder was in the host directory, so path
/conf.d/my_proxy.conf:/etc/nginx/conf.d/my_proxy.conf:ro
was not correct or something like that

@sirdiego
Copy link

sirdiego commented Nov 3, 2020

Maybe it helps someone else. I had this same message and the container restarted again and again. For me the problem was that I had a typo in my local config file path and docker created it as a directory instead:

-v /home/sirdiego/folder-with-typo/my_proxy.conf:/etc/nginx/conf.d/my_proxy.conf

With this docker created /home/sirdiego/folder-with-typo/my_proxy.conf as a DIRECTORY and so the proxy could not load the file. After I fixed the typo inside the mount everything worked fine...

@CaliforniaMountainSnake
Copy link

CaliforniaMountainSnake commented Mar 4, 2021

Make sure you use an absolute path when mounting a docker volume! I had the same issue when I tried to mount a volume with a relative path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants