title: Nginx location not working with regex
body: <p>I would like to catch all urls with this route /al/ or /ca/ etc.</p>
  
  <p>so www.mysite.com/ca/ or www.mysite/al/</p>
  
  <p>I tried </p>
  
  <pre><code>location ~ ^/([a-z]{2})/ {
  }
  </code></pre>
  
  <p>but couldn't get it working, not sure how to go about the regex in a location block. Nginx wont start, but when I hard code it to </p>
  
  <pre><code>location ~ /gb/ {
  }
  </code></pre>
  
  <p>it works fine.</p>