eugeneware / docker-wordpress-nginx

A Dockerfile that installs the latest wordpress, nginx and php-fpm.
MIT License
874 stars 380 forks source link

Nginx/virtualbox bug - disable sendfile #31

Closed joahua closed 9 years ago

joahua commented 9 years ago

Hi,

Thanks for this Dockerfile, it was really handy!

I don't know whether your project is worried about this because not everyone's using VirtualBox, but if you are, this PR implements a fix as described at https://docs.vagrantup.com/v2/synced-folders/virtualbox.html to this problem with shared filesystems: http://smotko.si/nginx-static-file-problem/

If you're just using Wordpress inside the docker image you may not notice this issue.

I came across this as I'd mounted a synced folder to do some plugin development and some files weren't being refreshed as per screenshot on the smotko.si post. This seems to impact static files only, as Nginx passes other requests to PHP which doesn't have the same issue.

Cheers, Josh

eugeneware commented 9 years ago

Thanks @joahua, though this might impact performance when deploy on bare metal, I would say that most people are using this Docker image for local development, so I'll merge it. Ideally we could detect the runtime environments somehow (ie. know you're running in VirtualBox), or pass an environment variable. But I think this is the 80% case.

Thanks for the PR!