Nginx to apache reverse proxy, instruct use of unix sockets

While you most likely could set Nginx to proxy redirect to a socket using unix:/path/to/socket syntax, Apache Listen directive only accepts IPv4 or IPv6, so as far as I know you can't get Apache to listen on an unix socket.


You need to define an upstream like this:

upstream upstream_name {
        server unix:/path/to/socket fail_timeout=0;
}

And then set proxy_pass to reference that upstream by name, i.e.,

proxy_pass http://upstream_name