title: Why is nginx claiming there's no terminating semicolon in my `rewrite` statement?
body: <p>I'd like to redirect a URL to a Django platform (via uwsgi) if and only if a cookie exists.  Failing that, I need to defer execution to the <code>content_by_lua</code> plugin.</p>
  
  <p>Below is my attempt at such logic:</p>
  
  <pre><code>location ~* "^/[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$" {  # match a UUID v4
      include uwsgi_params;
      if ($cookie_admin) {
          # if cookie exists, rewrite /&lt;uuid&gt; to /modif/&lt;uuid&gt; and pass to uwsgi
          rewrite ^/([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})$ /modif/$1 break; 
          uwsgi_pass frontend;
      }
      content_by_lua '
          ngx.say("Ping!  You got here because you have no cookies!")
      ';
  }
  </code></pre>
  
  <p>Nginx has deemed it necessary and proper to insult my intelligence with the following log message:</p>
  
  <pre><code>nginx: [emerg] directive "rewrite" is not terminated by ";" in /opt/openresty/nginx/conf/nginx.conf:34
  </code></pre>
  
  <p>Perhaps I am as dense as nginx seems to think, but what have I missed?</p>
  
  <p><strong>Bonus question:</strong> Is my general approach safe and sane?  Is there a better way of achieving my goals?</p>