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

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

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

4 Likes