title: nginx ignoring location with hyphens
body: <p>I am having a problem with nginx "location" directive and regular expressions.</p>
  
  <p>I want to have a location match a url that begins with "/user-profile".</p>
  
  <p>The problem is that nginx does not match that, however if I change the config and try with userprofile (i.e. no hyphen) it works like a charm.</p>
  
  <p>I think that there is regexp related problem, but can't get my head around it.</p>
  
  <p>My current config is:</p>
  
  <pre><code>location ^~ /user-profile {
      proxy_pass http://remotesites;
  }
  </code></pre>
  
  <p>And I've also tried with: </p>
  
  <pre><code>location ^~ /user\-profile {
      proxy_pass http://remotesites;
  }
  </code></pre>
  
  <p>I appreciate any help you can give me.</p>
  
  <p>Thanks! </p>