Forum Discussion

insomniak_11745's avatar
insomniak_11745
Icon for Nimbostratus rankNimbostratus
Aug 19, 2013

Restrict Access via HTTP referer

I'm attempting to restrict access to an application via HTTP REFERER. Using the example given by the dev team, I'm using something that looks like this:

when HTTP_REQUEST {
  switch -glob [HTTP::header "Referer"] {
"https://SUB.DOMAIN.COM/*" {
   Allow Request to go through...
}
"" {
  HTTP::respond 200 content "" 
}
default {
  HTTP::redirect [HTTP::header "Referer"]
}
  }
}

Unfortunately this isn't behaving as it should, and I'm not getting anything too helpful from the logs. Can you see anything glaringly wrong with this?

13 Replies