title: Nginx - Invalid number of arguments in location directive - regex capturing group with space
body: <p>Hello I've got a location directive with a case-insensitive regex match like this:</p>
  <pre><code>location ~* (/path/to/file withspace|/path/to/anotherfile) {
    return 404;
  }
  </code></pre>
  <p>When I reload nginx I get the following error message</p>
  <pre><code>nginx: [emerg] invalid number of arguments in &quot;location&quot; directive
  </code></pre>
  <p>After a bit of troubleshooting I found out that the problem is the whitespace in <code>/path/to/file withspace</code>.</p>
  <p>I've then tried the following, which works</p>
  <pre><code>location ~* &quot;/path/to/file withspace&quot; {
    return 404;
  }
  </code></pre>
  <p>but I'm unable to use the pipe for or-ing the paths to handle, which is an hassle to me.</p>
  <p>So:</p>
  <ul>
  <li>why isn't the whitespace allowed?</li>
  <li>generally, which characters aren't allowed there and how do I handle them?</li>
  </ul>
  <p>Thank you</p>