Welcome! Log In Create A New Profile

Advanced

http_referer, strange problem

Posted by szd55 
http_referer, strange problem
January 08, 2014 04:33AM
Hello

As a background there is one specific site we (for various reasons) don't allow to link to one directory in the nginx site.

Seems to be easy. If I put a PHP file in the directory it works just as wanted ie gives 403 error when accessed from unallowed domain (test so far). But the real contents I have to block is a flash-based e-book with a HTML file as the "head" of the flash. And when I access the html with the unwanted referer it opens the html and hence the flash.

My
(if $http_referer ~* (site-to-unallow|test-site)) {
return 403;
}

lies on the server level on a virtual host conf file (next to server_name, root and log-directives. I just don't get it, nor have I found any pointers from the Google-land...

Any suggestions?

hank
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 143
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready