Skip to content

Commit

Permalink
fix(nginx): header map regex
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm authored and alimd committed Dec 25, 2023
1 parent 7e274a6 commit 3e16b69
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

# extract $user_id_location from first 3 characters of `user-id` header.
map $http_user_id $user_id_location {
~^(?<prefix>.{3}) $storeRegionPerUser/$prefix/$http_user_id;
"~^(?<prefix>.{3})" $storeRegionPerUser/$prefix/$http_user_id;
default '';
}

# extract $user_token_location from first 3 characters of `user-token` header.
map $http_user_token $user_token_location {
~^(?<prefix>.{3}) $storeRegionPerToken/$prefix/$http_user_token;
"~^(?<prefix>.{3})" $storeRegionPerToken/$prefix/$http_user_token;
default '';
}

# extract $device_id_location from first 3 characters of `device-id` header.
map $http_user_device $user_device_location {
~^(?<prefix>.{3}) $storeRegionPerDevice/$prefix/$http_user_device;
"~^(?<prefix>.{3})" $storeRegionPerDevice/$prefix/$http_user_device;
default '';
}

0 comments on commit 3e16b69

Please sign in to comment.