# Error: nginx: [emerg] unexpected "/" in /etc/nginx/sites-enabled/mydomain.conf:48

**URL:** https://discourse.roots.io/t/error-nginx-emerg-unexpected-in-etc-nginx-sites-enabled-mydomain-conf-48/7847
**Category:** trellis
**Created:** 2016-10-07T18:24:00Z
**Posts:** 3

## Post 1 by @buretta — 2016-10-07T18:24:00Z

Have Trellis version with `Enable per-site setup for permalink structure ([#661]`

I am getting an NGINX error when I run `vagrant up` that I think is connected to some cache control configs. Is it possible that they need to be written differently now?

If I have the following applied in `development/wordpress_sites.yml` (see below)

```
cache:
      enabled: true
      duration: 30s
      skip_cache_uri: /wp-admin/|/xmlrpc.php|wp-..php|/feed/|index.php|sitemap(_index)?.xml|* "/gear.|/cart.|/my-account.|/checkout.|/addons.
      skip_cache_cookie: comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_cart_hash|woocommerce_items_in_cart|wp_woocommerce_session_|woocommerce_recently_viewed
```

I get the following error

```
RUNNING HANDLER [common : command] *********************************************
System info:
  Ansible 2.0.2.0; Vagrant 1.8.5; Darwin
  Trellis at "Enable per-site setup for permalink structure"
---------------------------------------------------
nginx: [emerg] unexpected "/" in /etc/nginx/sites-enabled/diveidc.com.conf:48
nginx: configuration file /etc/nginx/nginx.conf test failed
fatal: [default]: FAILED! => {"changed": true, "cmd": ["nginx", "-t"], "delta": "0:00:00.023851", "end": "2016-10-07 17:59:16.226771", "failed": true, "rc": 1, "start": "2016-10-07 17:59:16.202920", "stderr": "nginx: [emerg] unexpected \"/\" in /etc/nginx/sites-enabled/diveidc.com.conf:48\nnginx: configuration file /etc/nginx/nginx.conf test failed", "stdout": "", "stdout_lines": [], "warnings": []}

RUNNING HANDLER [common : service] *********************************************
System info:
  Ansible 2.0.2.0; Vagrant 1.8.5; Darwin
  Trellis at "Enable per-site setup for permalink structure"
---------------------------------------------------
Job for nginx.service failed because the control process exited with error
code. See "systemctl status nginx.service" and "journalctl -xe" for details.

fatal: [default]: FAILED! => {"changed": false, "failed": true}
```

If I remove it, things are all good.

I have followed the docs on how to apply `skip_cache_uri` and `skip_cache_cookie` but I think something has changed in the setup resulting in the error?

---

## Post 2 by @buretta — 2016-10-07T18:41:03Z

Updated to the following :

- changed `sitemap(_index)?.xml|* "/gear.|` to `sitemap(_index)?.xml|/gear.*`
- updated `wp-..php` to `wp-.*.php`

This has fixed things. Below is fully updated.

```
enabled: true
      duration: 30s
      skip_cache_uri: /wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml|/gear.*|/cart.*|/my-account.*|/checkout.*|/addons.*
      skip_cache_cookie: comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_cart_hash|woocommerce_items_in_cart|wp_woocommerce_session_|woocommerce_recently_viewed
```

If you follow this discussion and copy/paste exactly what is written it may result in the same issue I had

> [@WooCommerce + Roots Stack – BUGGY Cart](https://discourse.roots.io/t/woocommerce-roots-stack-buggy-cart/7554/6):
>
> Thanks Emzo, I’d actually already reached this point myself but appreciate your help slight_smile I guess it’s good to note for anyone hoping to get WooCommerce working glitch free with FastCGI Caching skip\_cache\_uri: /wp-admin/|/xmlrpc.php|wp-.\*.php|/feed/|index.php|sitemap(\_index)?.xml|\* "/store.\*|/cart.\*|/my-account.\*|/checkout.\*|/addons.\* skip\_cache\_cookie: comment\_author|wordpress\_[a-f0-9]+|wp-postpass|wordpress\_no\_cache|wordpress\_logged\_in|woocommerce\_cart\_hash|woocommerce\_items\_in\_ca…

I am still unsure if how I have written the cache control will still work as intended, will test shortly.

---

## Post 3 by @inthedeepend — 2016-10-10T22:33:55Z

Nice one @buretta - will be using this from here on.
