Welcome! Log In Create A New Profile

Advanced

Re: valid_referers dynamic hostname

B.R.
May 20, 2013 02:28PM
I suggest you take a look at the order in which 'if' statements are
evaluated.
Consider reading the 'if' directive
documentation<http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if>
..
---
*B. R.*


On Mon, May 20, 2013 at 2:14 PM, vlad031@binkmail.com
<nginx-forum@nginx.us>wrote:

> Hello,
>
> Thank you for your example Maxim. This is what I've wrote in my config:
>
> set $temp "$host:$http_referer";
>
> valid_referers none blocked server_names ~\.google\. ~\.yahoo\. ~\.bing\.
> ~\.ask\. ~\.live\. ~\.googleusercontent.com\. ;
>
> if ($invalid_referer){
> set $test A ;
> }
>
> if ($temp ~* "^(.*):http?://\1") {
> set $test "${test}B";
> }
>
> if ($temp ~* "^(.*):https?://\1") {
> set $test "${test}C";
> }
>
> if ($test = ABC) {
> return 444 ;
> }
>
> It is always returning 444 ... what am I doing wrong?!
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,239318,239352#msg-239352
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

valid_referers dynamic hostname

vlad031@binkmail.com May 18, 2013 01:31PM

Re: valid_referers dynamic hostname

vlad031@binkmail.com May 20, 2013 07:27AM

Re: valid_referers dynamic hostname

Maxim Dounin May 20, 2013 09:20AM

Re: valid_referers dynamic hostname

vlad031@binkmail.com May 20, 2013 02:14PM

Re: valid_referers dynamic hostname

B.R. May 20, 2013 02:28PM

Re: valid_referers dynamic hostname

Maxim Dounin May 20, 2013 02:36PM

Re: valid_referers dynamic hostname

vlad031@binkmail.com May 24, 2013 07:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 311
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