Welcome! Log In Create A New Profile

Advanced

Check the size of one of the request header in nginx conf

Posted by mejetjoseph 
Dear Team,

I would like to know is it possible to check the size of one of header
values in nginx conf file . I need to reset the header value if the size of
this header value exceed 64 character.

Could you please provide can I able to do this condition check in ngnix conf
file?


Kind regards,
Joseph

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278940,278940#msg-278940

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
hi,

I think you can do such a checking with lua/njs modules.


br,
Aziz.





> On 6 Mar 2018, at 15:13, mejetjoseph <[email protected]> wrote:
>
> Dear Team,
>
> I would like to know is it possible to check the size of one of header
> values in nginx conf file . I need to reset the header value if the size of
> this header value exceed 64 character.
>
> Could you please provide can I able to do this condition check in ngnix conf
> file?
>
>
> Kind regards,
> Joseph
>
> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278940,278940#msg-278940
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
by the way, there is easier solution to this (thanks to Ruslan Ermilov)

something like this:

map $http_<header_name> $disabled {
^.{65,} 1
}

location / {
if $disable {
return 404;
}
proxy_pass http://upstream;
}


br,
Aziz.





> On 6 Mar 2018, at 15:16, Aziz Rozyev <[email protected]> wrote:
>
> hi,
>
> I think you can do such a checking with lua/njs modules.
>
>
> br,
> Aziz.
>
>
>
>
>
>> On 6 Mar 2018, at 15:13, mejetjoseph <[email protected]> wrote:
>>
>> Dear Team,
>>
>> I would like to know is it possible to check the size of one of header
>> values in nginx conf file . I need to reset the header value if the size of
>> this header value exceed 64 character.
>>
>> Could you please provide can I able to do this condition check in ngnix conf
>> file?
>>
>>
>> Kind regards,
>> Joseph
>>
>> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278940,278940#msg-278940
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Sorry, only registered users may post in this forum.

Click here to login