Answer the question
In order to leave comments, you need to log in
Redirecting nginx traffic from different ips?
It is necessary to correctly configure redirected traffic queues so that if the server receives traffic from the application server (10.1.87.208), then the traffic is sent to (109.100.15.157 or 109.100.15.158 ) and if the traffic comes from these ips from outside, then the server sends it to the application server ( 10.1.87.208).
I tried to do it myself according to analogues, it turned out like this, but I guess I made a mistake somewhere.
upstream activemq_out {
server 109.100.15.157:61616;
server 109.100.15.158:61616;
}
upstream activemq_in {
server 10.1.87.208:61616;
}
map "$remote_addr" $upstream_class
{
# default "backend";
"~109.100.15.157" "activemq_in";
"~109.100.15.158" "activemq_in";
"~10.1.87.208" "activemq_out";
}
server {
listen 61616;
#server_name localhost;
proxy_pass http://$upstream_class;
}
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