Hi,
i would like to implement restriction on the base of specific value in http header (currently implemented and it works) or specific IP address. So if the traffic has specific http header value OR if the traffic is coming from specific IP address the traffic should be permitted the other traffic should be denied. How to add OR rule for IP addresses?
Current config is something like following:
upstream www_domain {
server origin:443 resolve;
zone upstream_backend 256k;
}
server {
listen 80;
server_name www.domain.com;
access_log /var/log/nginx/access.log main;
proxy_pass_header Server;
location / {
access_by_lua 'validate_nginx(3, "xyz", 30)';
proxy_pass https://www_domain;
proxy_set_header Host $server_name;
real_ip_header X-Forwarded-For;
set_real_ip_from 0.0.0.0/0;
}
}
Thanks,
Oblack
i would like to implement restriction on the base of specific value in http header (currently implemented and it works) or specific IP address. So if the traffic has specific http header value OR if the traffic is coming from specific IP address the traffic should be permitted the other traffic should be denied. How to add OR rule for IP addresses?
Current config is something like following:
upstream www_domain {
server origin:443 resolve;
zone upstream_backend 256k;
}
server {
listen 80;
server_name www.domain.com;
access_log /var/log/nginx/access.log main;
proxy_pass_header Server;
location / {
access_by_lua 'validate_nginx(3, "xyz", 30)';
proxy_pass https://www_domain;
proxy_set_header Host $server_name;
real_ip_header X-Forwarded-For;
set_real_ip_from 0.0.0.0/0;
}
}
Thanks,
Oblack