Proxy Bypass only specific IP

TheBritishGeek nginx-forum at
Tue Jun 24 04:43:12 UTC 2014

I am looking for a way for allow that proxy_cache_bypass but only on a
secific hostname and client IP address.

My current setup is as follows:

location ~*
            expires 1M;
            add_header X-Cache-Status $upstream_cache_status;
            proxy_cache_bypass $http_secret_header;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_cache_valid 200 360m;
            proxy_cache_valid 302 360m;
            proxy_cache_valid 404 1m;
            proxy_cache_use_stale error timeout invalid_header updating;
            proxy_ignore_headers X-Accel-Expires Expires;

How can I add to this protection so that only 1 specific IPv4 & 1 IPv6
address can bypass the poxy ?

Posted at Nginx Forum:,251124,251124#msg-251124

More information about the nginx mailing list