Skip to content

Instantly share code, notes, and snippets.

@johnhpatton
Created September 27, 2020 14:19
Show Gist options
  • Save johnhpatton/bd72123169d8685f075925f55cdd4428 to your computer and use it in GitHub Desktop.
Save johnhpatton/bd72123169d8685f075925f55cdd4428 to your computer and use it in GitHub Desktop.
product_number nginx map
# Get product_number from the product availability URI:
# /api/product/check_availability/{product_number}
# where
# product_number begins with an alpha character and ends with 7 digits.
map $request_uri $product_number {
"~^/api/product/check_availability/(?<re_match>[a-zA-Z]\d{7})$" $re_match;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment