<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="markdown-here-wrapper" data-md-url="" style="">
      <p style="margin: 0px 0px 1.2em !important;">Hi there,</p>
      <p style="margin: 0px 0px 1.2em !important;">Thanks for getting
        back.</p>
      <p style="margin: 0px 0px 1.2em !important;">On 4/6/23 3:16 am,
        Maxim Dounin wrote:</p>
      <p style="margin: 0px 0px 1.2em !important;"></p>
      <div class="markdown-here-exclude">
        <blockquote type="cite" cite="mid:ZHt1V14rI3Du4TGf@mdounin.ru">
          <pre class="moz-quote-pre" wrap="">Hello!
</pre>
        </blockquote>
      </div>
      <p style="margin: 0px 0px 1.2em !important;"></p>
      <p style="margin: 0px 0px 1.2em !important;">[…]</p>
      <p style="margin: 0px 0px 1.2em !important;"></p>
      <div class="markdown-here-exclude">
        <blockquote type="cite" cite="mid:ZHt1V14rI3Du4TGf@mdounin.ru">The
          "^~" location modifier is for prefix-match locations to
          prevent further checking of regular expressions, see
          <a class="moz-txt-link-freetext" href="http://nginx.org/r/location">http://nginx.org/r/location</a> for details. If you want to use a
          regular expression, you have to use the "~" modifier instead.</blockquote>
      </div>
      <p style="margin: 0px 0px 1.2em !important;"></p>
      <p style="margin: 0px 0px 1.2em !important;">Thank you for that.
        Apologies, I should’ve mentioned that I did review that
        documentation on how nginx selects a location. Unfortunately I
        didn’t find it particularly clear or helpful.</p>
      <p style="margin: 0px 0px 1.2em !important;">I especially thought
        this rule in question would match and take precedence over the
        latter /browser rule, because of this line on that page:</p>
      <p style="margin: 0px 0px 1.2em !important;"></p>
      <div class="markdown-here-exclude">
        <blockquote>
          <p>"If the longest matching prefix location has the “^~”
            modifier then regular expressions are not checked."<br>
          </p>
        </blockquote>
      </div>
      <p style="margin: 0px 0px 1.2em !important;"></p>
      <p style="margin: 0px 0px 1.2em !important;">i.e. because this
        rule in question comes first and it is longer than the latter
        /browser rule, a match would occur here and not later (because
        processing stops here)?</p>
      <p style="margin: 0px 0px 1.2em !important;">And because I
        couldn’t find much on how nginx handles regex, I ended up
        checking <a href="https://stackoverflow.com/questions/59846238">this
          question/answer</a> on Stackoverflow. It cleared things up a
        little, but still made me wonder why my approach didn’t work.</p>
      <p style="margin: 0px 0px 1.2em !important;">Nevertheless, your
        suggestions to remove the priority prefix <code style="font-family: Consolas, Inconsolata, Courier, monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; font-weight: 550; background-color: rgba(119, 119, 119, 0.3); border-radius: 3px; display: inline;">^~</code>
        for the second rule fixed the problem, but I still wonder why my
        approach didn’t work. ;)</p>
      <p style="margin: 0px 0px 1.2em !important;">Speaking of
        Stackoverflow, I ended up asking the <a
          href="https://stackoverflow.com/questions/76396334">question
          there also</a>. Not to take this conversation away from this
        list, but since your answer was helpful, feel free to chime in
        there too if you’re looking for some upvotes :)</p>
      <p style="margin: 0px 0px 1.2em !important;">Thanks,<br>
        Jore</p>
      <div
title="MDH:PHA+SGkgdGhlcmUsPC9wPjxwPlRoYW5rcyBmb3IgZ2V0dGluZyBiYWNrLjwvcD48cD48YnI+T24gNC82LzIzIDM6MTYgYW0sIE1heGltIERvdW5pbiB3cm90ZTo8YnI+PC9wPjxibG9ja3F1b3RlIHR5
cGU9ImNpdGUiIGNpdGU9Im1pZDpaSHQxVjE0ckkzRHU0VEdmQG1kb3VuaW4ucnUiPjxwcmUgY2xh
c3M9Im1vei1xdW90ZS1wcmUiIHdyYXA9IiI+SGVsbG8hCjwvcHJlPjwvYmxvY2txdW90ZT48YnI+
Wy4uLl08YnI+PGJyPjxibG9ja3F1b3RlIHR5cGU9ImNpdGUiIGNpdGU9Im1pZDpaSHQxVjE0ckkz
RHU0VEdmQG1kb3VuaW4ucnUiPlRoZSAiXn4iIGxvY2F0aW9uIG1vZGlmaWVyIGlzIGZvciBwcmVm
aXgtbWF0Y2ggbG9jYXRpb25zIHRvIHByZXZlbnQgZnVydGhlciBjaGVja2luZyBvZiByZWd1bGFy
IGV4cHJlc3Npb25zLCBzZW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=="
        aria-hidden="true"
style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0;padding:0;margin:0;">​</div>
    </div>
  </body>
</html>