Gary Kupczak
Gary Kupczak

Reputation: 77

How do I edit the nginx.conf for a VVV-instantiated VM?

I am trying to use VVV to set up a local development environment for an existing WordPress site (hosted on WP Engine if it makes any difference) but am unable to change the nginx.conf to point to the correct webroot.

Following the official documentation I have provisioned a new site using the base custom site template then swapped it for our WordPress install and database.

This creates a site with a public_html webroot. Since our site is on Apache we have an htdocs folder instead. So, per these instructions I have edited provision/vvv-nginx.conf to change the root and have reprovisioned.

On reprovisioning, the nginx.conf gets overwritten with the original one form the custom site template.

Why is this happening and how do I fix it?

I have also tried sshing into the vagrant box and manually editing the config per these instructions but that didn't seem to work either.

Upvotes: 2

Views: 286

Answers (1)

Gary Kupczak
Gary Kupczak

Reputation: 77

You need to fork the custom site template.

Per discussion with the developers, the custom site template init script resets everything on each provision, including the vvv-nginx.conf files.

And since you need to provision to set up the VM, to change the paths you need to fork and modify the template itself. Either by editing vvv-nginx.conf or by modifying the behavior of vvv-init.sh.

Upvotes: 2

Related Questions