I want to use a test server for administrators.
Is there a way to assign an access from the client of ip(123.0.0.1
) to the server of ip(123.0.0.2
)?
upstream target-server {
server [123.0.0.3] ;
server [123.0.0.2] ;
}
I want to use a test server for administrators.
Is there a way to assign an access from the client of ip(123.0.0.1
) to the server of ip(123.0.0.2
)?
upstream target-server {
server [123.0.0.3] ;
server [123.0.0.2] ;
}
You may use if statement in location to map traffic to your service.
upstream target-server {
server 123.0.0.3 ;
server 123.0.0.2 ; }
server{
***
location / {
if ($remote_addr = 123.0.0.1) {
proxy_pass http://123.0.0.2 ;
}
proxy_pass http://target-server ;
}
}