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 {
    location / {
        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.

1 Answer 1


Have you tried to:

proxy_bind $server_addr;

I'm not 100% sure if that variable is available within a proxy configuration. But it should contain address of the specific connection.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.