I am using nginx and trying to read a custom header from an internal page. $http_name variable doesn't work with my nginx/1.14.2 server.
if ($http_crawler != '1') {...}
Do you have any idea how to do this?
location /download/ {
# preserves bandwidth
limit_req zone=limit_by_addr burst=5 nodelay;
limit_req_status 429;
# all types of files except directories
location ~ .+(?<!/)$ {
# force login for download
auth_request /account/auth.php;
error_page 401 = @login;
# check if not googlebot
# auth.php returns a custom header if detect googlebot "header('crawler: 1');"
if ($http_crawler != '1') {
# preserves bandwidth
limit_conn conn_limit_per_ip 5;
limit_rate_after 1000m;
limit_rate 100k;
}
}
}