Nginx: Reject request if header is not present

It was surprisingly difficult to find a full working example of this, so here’s my take on “How to make Nginx require that a certain header is present with a certain value in the incoming request”: nginx.conf: http { map $http_x_mycustomheader $is_mycustomheader_not_ok { default “1”; MyApprovedValue “0”; } … } mysite.conf: server { … location… Continue reading Nginx: Reject request if header is not present

Published
Categorized as IT