I have an nginx config that passes incoming requests to a local unix socket that's specifically listening for incoming requests
(If you're curious, this happens to be a Rails app running puma, but the question is generally applicable)
upstream app {
server unix:/var/www/example.com/volumes/tmp/sockets/puma.sock fail_timeout=0;
}
server {
listen 443 ssl;
server_name example.com;
# Forward incoming requests to the socket
location @app {
proxy_pass http://app;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}
# ...
}
If I am logged into the local machine where this app is running, how do I send http requests to this Unix socket?
I can't seem to do -
curl unix://%2Fvar%2Fwww%2Fexample.com%2Fvolumes%2Ftmp%2Fsockets%2Fpuma.sock
curl: (1) Protocol "unix" not supported or disabled in libcurl