NGINX does not collect changes in the Vagrant Synced folder

I have a Ubuntu VirtualBox that is configured by Vagrant. Its launch is NGINX to serve some static files and the Django application.

I have a source folder synchronized through the repo firewall in my host (windows). I can make changes to the Javascript file on Windows and make sure that the changes are made to my file in VM by SSH'ing and opening the file in nano.

However, when I make the changes remotely, NGINX seems to be serving an unchanged version with “illegal” characters added to the end (which is what browsers really care about). I get the same file when I CURL localhost and ssh'd in vm. EDIT . In fact, it does the same when I edit a file via SSH

I can reload vm through a firewall (which resynchronizes folders) and it works fine until the next remote change.

Restarting nginx and gunicorn do not help.

Does the tramp block files so that nginx must rely on the cache? What could be here?

Thanks!

+6
source share
1 answer

My colleague seems to have better google-foo than mine.

This is apparently a known issue with virtualbox and nginx, which is related to the nginx send file. You can simply add "sendfile off"; in your server or location blocks in nginx configuration. Here's a blogpost about it: nginx virtualbox static files

+8
source

All Articles