I have a uwsgi server running for unix domain socket
[uwsgi]
...
socket = /var/run/someuwsgi.sock
socket = localhost:9987
...
The mod_proxy_uwsgi is installed
In apache config has that line: ProxyPass /some uwsgi://localhost:9987
And it is working.
Question: what should be the apache config line to go through unix domain socket /var/run/someuwsgi.sock ? I tried
ProxyPass /some uwsgi:///var/run/someuwsgi.sock
and got
Bad Request
Your browser sent a request that this server could not understand.
Also tried
ProxyPass /some uwsgi://unix:///var/run/someuwsgi.sock
and got
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /some/.
Reason: DNS lookup failure for: unix:
Thanks!
A UNIX socket is an inter-process communication mechanism that allows bidirectional data exchange between processes running on the same machine. IP sockets (especially TCP/IP sockets) are a mechanism allowing communication between processes over the network.
A Unix domain socket aka UDS or IPC socket (inter-process communication socket) is a data communications endpoint for exchanging data between processes executing on the same host operating system. It is also referred to by its address family AF_UNIX .
The traditional UNIX system calls are blocking. For example: accept() blocks the caller until a connection is present. If no messages space is available at the socket to hold the message to be transmitted, then send() normally blocks.
Valid socket types in the UNIX domain are: SOCK_STREAM, for a stream-oriented socket; SOCK_DGRAM, for a datagram-oriented socket that preserves message boundaries (as on most UNIX implementations, UNIX domain datagram sockets are always reliable and don't reorder datagrams); and (since Linux 2.6.
Starting from Apache 2.4.7, support for Unix sockets has been added. The syntax is pretty simple:
ProxyPass / unix:/tmp/uwsgi.sock|uwsgi://
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With