I have a server with multiple network interfaces, and I want to write a proxy server, which would listen on all of these IPs.
My config so far:
server {
listen 111.111.111.111:40000;
listen 111.111.111.222:40000;
location / {
resolver 8.8.8.8;
proxy_bind <listen interface here>;
proxy_pass http://$host;
}
}
If I omit proxy_bind
directive, Nginx sends request from the default IP, not the one I send request to.
Is it possible to fix this? If I could get the IP, request came to, it would solve my problem.