-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nginx): Add user/device/token locations headers mappings
Co-authored-by: S. Amir Mohammad Najafi <[email protected]>
- Loading branch information
Showing
2 changed files
with
23 additions
and
16 deletions.
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
packages/nginx/etc/nginx/templates/http.d/49-map-bearer-token.conf.template
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
packages/nginx/etc/nginx/templates/http.d/49-map-headers.conf.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ''; | ||
} |