nginx serves corrupted files when files edited in host mounted volume
stefanfoulis opened this issue · comments
I'm not sure if this issues lies with docker itself, docker-osx or nginx.
julien-duponchelle/docker-osx#68
This is probably related to this:
https://www.virtualbox.org/ticket/10660?cversion=0&cnum_hist=1
(ie, VBox guest additions don't support inotify)
It could also be #6 - are you mounting a single file and then sending a SIGHUP
to nginx, or are you mounting a directory? Also, are we talking about the configuration files, or HTML files being served by nginx?
I'm mounting a whole directory of files to be served from /usr/local/nginx/html
.
If the problem has to do with inotify it would mean that nginx or the sharing mechanism uses inotify to detect file length, but not for the content. And the weird thing is, that nginx will continue to serve an old version of the file even after destroying the container and re-creating it. Which points in the direction of problem with the mounting in Virtualbox not picking up on the changes (file length vs file content) correctly.
Sorry for not updating here sooner: Nginx upstream is now providing and maintaining this image at nginxinc/docker-nginx.