Skip to content

Commit

Permalink
feat(nginx): Add user/device/token locations headers mappings
Browse files Browse the repository at this point in the history
Co-authored-by: S. Amir Mohammad Najafi <[email protected]>
  • Loading branch information
alimd and njfamirm committed Dec 25, 2023
1 parent 756a99e commit 3e71297
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# extract $bearer_token from $http_authorization header.
# map $http_authorization $bearer_token {
# ~*^Bearer\s+(?<token>\S+)$ $token;
# default '';
# }

# 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;
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;
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;
default '';
}

0 comments on commit 3e71297

Please sign in to comment.