Answer the question
In order to leave comments, you need to log in
nginx. How to map internal subnets to fulfill the condition for them?
Hello everyone
I want to make it so that for users from the local network of the office a different proxy_pass is performed, unlike users from outside.
I'm trying to do so
map $remote_addr $internal {
default off;
192.168.100.0/24 on;
192.168.200.0.24 on;
}
server {
..........
location /ops{
if ($internal = on){
proxy_pass ip_proxy1;
}
proxy_pass ip_proxy2;
}
.........
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question