Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Compare $http_referer and $host

$
0
0
Hi,

Is it possible to compare $http_referer and $host variables with regexp like this?

if ( $http_referer ~ $host ) {
set $match 1;
}

I want to check if http_referer is equal to host in order to send pages from cache. I have one default_server config because I'm using wildcard as domain name so any domain name pointed to IP will show default page.

I've tried with ~* ^http://$host but it does not work probably because of $ sign in host variable.

Any advice is welcome.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>