I have Windows Host for CentOS Guest VM that is running php-fpm + nginx + mysql using the following synced_folder in my vagrantfile:
Vagrant.configure('2') do |config| config.vm.synced_folder '../sites/example.ca', '/srv/www/example.dev/current', type: "rsync", rsync__args: [ "--verbose", "--archive", "--delete", "-z", "--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r" ]
That has a documented limitation that rsync is one-way from host to guest. Which is fine, except for those times when I run composer update in the VM. My host PC files are then out of date and subsequent rsync will overwrite / delete.
However if I use the standard synced_folder equivalent nginx does not see the folder and I get 404 errors with permissions issues in the log. For comparison:
config.vm.synced_folder "../sites/example.ca", "/srv/www/example.dev/current/", create: true, mount_options: ["dmode=774,fmode=774"]
This seems like a rather common scenario that others would / should have encountered but nothing on the googles has shown me a solution yet. Suggestions?