marcin_koss
marcin_koss

Reputation: 5882

Virtualbox + Vagrant corrupted static files issue

There's a lot of people reporting issues with nginx and virtualbox. Solution that works for most seems to be using sendfile off in nginx config. I've been experiencing similar problem with corrupted js and css files after updates. I tried switching sendfile to off in nginx config and restarting VM but this did not help. I decided to serve application through uwsgi only instead of uwsgi+nginx but the problem persisted.

In my case I have a Flask application that resides in host filesystem and is shared with VM to /home/vagrant/appname. After doing some experimenting I found out that copying application files into VMs filesystem fixes the issue. This way code now actually resides in /home/vagrant/appname. I still don't know exactly what is causing this and preferably I would like the codebase to reside on host for easy editing.

Upvotes: 1

Views: 439

Answers (1)

NucFlash
NucFlash

Reputation: 101

I'm using uwsgi (no nginx) to develop my app in a Vagrant VM with VirtualBox 5.0.4 on OS X 10.10.5. I'm using shared folders, and just like you, I had issues with corrupted static files, i.e., .js. What did the trick for me was to add --disable-sendfile when I'm starting the app with uwsgi, e.g., :

uwsgi --http IP:PORT -w app --disable-sendfile

Upvotes: 1

Related Questions