This repository has been archived by the owner on Apr 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
nginx serves corrupted files when files edited in host mounted volume #68
Comments
This was referenced Aug 22, 2014
stefanfoulis
changed the title
file changes not being picked up with mounted volume from host and nginx
nginx serves corrupted files when filed edited in host mounted volume
Aug 22, 2014
stefanfoulis
changed the title
nginx serves corrupted files when filed edited in host mounted volume
nginx serves corrupted files when files edited in host mounted volume
Aug 22, 2014
I am having the exact same issue. Same versions.. same behaviour. I think it is related to the VirtualBox sendfile issue. What solved it for me was adding |
same problem, mrmaxon's workaround works for me |
same problem here, and it works with |
I'm having the same issue, this really needs to be fixed |
I had to restart docker-machine and after that all became ok: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I get weird file corruption when mounting
/var/www
into this container. It seems to be specific to nginx in combination with docker-osx (not sure if the same happens with other virtualisation countainers that mount stuff from the host machine into the VM). I could not reproduce this on a pure linux/docker host. I had this on MacOSX 10.9.4 and a fresh docker-osx install.All fine so far.
So far so good. Let's add something to the file
The new line is missing. Even stopping the container and starting a new one will not have the change show up.
And what is super weird, I can connect to the container with bash, run nginx in the backround and observe the files changing in the filesystem. But nginx does not pick them up.
but at the same time from the host:
Deleting the file gets picked up though
And now it gets interesting. Overwriting a file with a shorter content will show the content of the old file, but truncated at the length of the new file.
It looks like it's tied to the first request done with a new file. If you delete the file and make at least one request for that file and get a 404 and then re-add it, the new file contents will be picked up.
It seems to be a combination of docker-osx and nginx (I experienced this with the orchardup/nginx docker image as well. We did a quick test with an apache image, which did not show this behaviour.
My wild speculation: I suspect nginx is doing some deep magic in the way it detects file changes and caches it somehow (but apparently not just in memory, otherwise it would not survive container destruction and restart). Something with the docker abstraction of the volumes (and maybe just in combination of using a volume that was shared to the vm from the host os) and how nginx reads the files.
I'm linking this issue from docker and the official nginx docker image as well, as I'm not sure where the issue originates.
Some additional environment information:
The text was updated successfully, but these errors were encountered: