Welcome! Log In Create A New Profile

Advanced

Re: Proxy Bypass only specific IP

Maxim Dounin
June 24, 2014 10:24AM
Hello!

On Tue, Jun 24, 2014 at 06:38:59AM -0400, TheBritishGeek wrote:

> I have tried
>
> if ($remote_addr ~ "^(1.1.1.1|a:b:c:d::1:2)$")
> {
> proxy_cache_bypass $http_secret_header;
> }
>
> But is does not pass testing
>
> nginx: [emerg] "proxy_cache_bypass" directive is not allowed here

You have to set a variable as appropriate, and then use it in the
proxy_set_bypass directive.

if (...) {
set $bypass $http_secret_header;
}

proxy_cache_bypass $bypass;

Also, apart from "if" checks, it may be good idea to consider geo
and map blocks, see here:

http://nginx.org/en/docs/http/ngx_http_geo_module.html
http://nginx.org/en/docs/http/ngx_http_map_module.html

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Proxy Bypass only specific IP

TheBritishGeek June 24, 2014 12:43AM

Re: Proxy Bypass only specific IP

itpp2012 June 24, 2014 02:17AM

Re: Proxy Bypass only specific IP

TheBritishGeek June 24, 2014 06:38AM

Re: Proxy Bypass only specific IP

Maxim Dounin June 24, 2014 10:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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