how to get http_referer in nginx mod_perl

291 views Asked by At

I have an nginx mod perl module which gets data and takes action based on parameters in my script I am not able to get the http referer

I am trying

$r->header_in("http_referer")   # Gives an undefined string
$r->headers_in()    # func not defined

How can I get all the headers passed by the http client inside my function

1

There are 1 answers

0
Steffen Ullrich On BEST ANSWER
$r->header_in("http_referer")   # Gives an undefined string

The request header field you are looking for is not http_referer but referer, i.e. useheader_in("referer"). See MDN documentation for more on this field.