0
votes

I'm running Laravel/Homestead as my Vagrant box and have heard that Nginx has some weird caching issues. The way to solve the problem is to set "sendfille off" in the nginx config file.

How can I provision my Laravel/Homestead Vagrant box so that I don't have to ssh into the box and modify the setting?

1

1 Answers

0
votes

In your host's homestead folder you can find homestead/scripts/serve.sh. There sendfile is already set to off as default for your app. I think this will set nginx sendfile option to off.

If you still want to edit the nginx.conf permanently, write a line of code into serve.sh to change the config file.

More info on serve.sh

The serve.sh script will run on --provision for any site configured in the Homestead.yaml.

It creates each site in /etc/nginx/sites-available/ and symlinks it to /etc/nginx/sites-enabled/. Nginx and php5-fpm get restarted after that.

In nginx.conf we can see at the end of the http{...}-block has:

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

This includes all sites in /etc/nginx/sites-available/ where the server{...}-blocks are defined. For more information about nginx config look at the Nginx Admin Guide.