I have an Ubuntu VirtualBox that's setup by Vagrant. Its running NGINX to serve some static files and a Django app.
I have the source folder synced via vagrant to the repo in my host (windows). I can make changes to a Javascript file in Windows and verify that the changes are made to my file in the VM by SSH'ing in and opening the file in nano.
However, when I make the changes remotely, NGINX seems to serve up the unchanged version with "illegal" characters added to the end (which really freaks out browsers). I get the same file when I CURL localhost while ssh'd into the vm. EDIT It actually does the same thing when I edit the file via SSH
I can reload the vm via vagrant (which re-syncs the folders) and it works fine until the next remote change.
Restarting nginx and gunicorn doesn't help.
Does vagrant lock the files so that nginx has to rely on a cache? What might be going on here?
Thanks!
Apparently my coworker has better Google-foo than I.
This is apparently a known issue with virtualbox and nginx that has to do with the nginx's sendfile. You can simply add "sendfile off;" in either your server or location blocks in the nginx config. Here's a blogpost about it: nginx virtualbox static files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With