# Trellis not building nginx includes on provision

**URL:** https://discourse.roots.io/t/trellis-not-building-nginx-includes-on-provision/11345
**Category:** trellis
**Tags:** nginx
**Created:** 2018-01-18T05:35:23Z
**Posts:** 3

## Post 1 by @needle — 2018-01-18T05:35:23Z

Following [the documentation](https://roots.io/trellis/docs/nginx-includes/) I’m attempting to set up a simple Nginx include that contains my 301 redirects. My local folder structure looks like this

`trellis/nginx-includes/mysite.com/rewrites.conf.j2`

However, when I provision the server the files aren’t getting templated to the remote. When I ssh into the server, I can see that the Nginx config for my site does have the new include statement, but there is no corresponding directory at `etc/nginx/includes.d` so the redirects don’t exist.

I have tried running provisioning both with `--tags nginx-includes` as well as without. The first time I provisioned the output did show 3 changed files, but on subsequent tries it just completes with no changes reported. I’m especially confounded because I have an identical setup on a different project that works fine. I even SSHed into the remote server and created the includes.d directory myself, but upon reprovisioning the directory is still empty. I don’t know what else to try at this point.

Any insights greatly appreciated.

---

## Post 2 by @swalkinshaw — 2018-01-19T02:56:49Z

:thinking: strange. I’d suggest including a debug task to see if the local files are being picked up.

You can add the following:

```
- debug:
    var: nginx_includes_templates
```

in `roles/wordpress-setup/tasks/nginx-includes.yml`. Right after the first “Build list of Nginx includes templates” task should work.

Then re-provision with that tag again and it should output a list of files ideally.

---

## Post 3 by @needle — 2018-01-19T06:49:26Z

I added the debug task and re-provisioned, and the output was

```
TASK [wordpress-setup : debug] 
*************************************************************************************
Hello world!
ok: [ip address]
```

so I guess it’s not picking up the local files. I just double-checked the folder structure and still can’t see any reason for it.

**UPDATE:** Ugh. Turns out I was SSHing into the _wrong server_ when I went to check on the remote files. :man_facepalming: So of course I wasn’t seeing anything - I was looking on my staging server and thinking I was on production. Just tried again and the nginx-includes are getting templated to production as expected. Still not sure why my redirects weren’t working originally but I can sort that out now. Thanks @swalkinshaw for taking a look all the same!
