DevOps · Flashcard

What does the ^~ modifier on a location do when it is the longest matching prefix?

  • AIt stops nginx from checking regular-expression locations and uses this prefix location
  • BIt forces nginx to check regular-expression locations first and prefer their result
  • CIt makes the prefix comparison case-insensitive when tested against the request URI
  • DIt marks the location as internal so only redirected requests are able to reach it

Why this is the answer

^~ tells nginx that if this prefix is the longest match, use it without evaluating any regex locations. It does the opposite of preferring regex; case-insensitivity comes from ~* on regex locations, not ^~; and internal-only access is the internal directive, unrelated to ^~.

Official docs
Study in Gnoseed →