My end goal is to implement a rate limit based on the authorization header value and, as a fallback, the client IP.
Here is the map directive, which is working fine.
```
map $http_authorization $rate_limit {
default $binary_remote_addr;
'~*.*' $http_authorization;
}
```
However, it seems that the authorization header value is too lengthy, and is greater than 255 bytes.
```
2021/01/01 05:51:18 [error] 28#28: *287 the value of the "$rate_limit" key is more than 255 bytes: "Bearer XXX...XXX", client: 0.0.0.0, server: _, request: "GET / HTTP/1.1", host: "host.com"
```
How would you go about properly shortening `$rate_limit`? Any suggestions? Is there any way to increase this 255 byte limit within the nginx.conf file?
I attempted to truncate the token value with something like `"~^(.{25})" $http_authorization;`, but that didn't seem to work either because I am seeing the same error.
Thank you!
Here is the map directive, which is working fine.
```
map $http_authorization $rate_limit {
default $binary_remote_addr;
'~*.*' $http_authorization;
}
```
However, it seems that the authorization header value is too lengthy, and is greater than 255 bytes.
```
2021/01/01 05:51:18 [error] 28#28: *287 the value of the "$rate_limit" key is more than 255 bytes: "Bearer XXX...XXX", client: 0.0.0.0, server: _, request: "GET / HTTP/1.1", host: "host.com"
```
How would you go about properly shortening `$rate_limit`? Any suggestions? Is there any way to increase this 255 byte limit within the nginx.conf file?
I attempted to truncate the token value with something like `"~^(.{25})" $http_authorization;`, but that didn't seem to work either because I am seeing the same error.
Thank you!