0

Nginx reverse proxy of ajenti doesn't work when using unix socks

zodiacg 9 years ago 0
When Ajenti is set to listen on 0.0.0.0:8000, nginx reverse proxy works well. I added self-signed ssl support in nginx and disabled Ajenti's ssl support.
But when I change Ajenti to work using unix socks like /var/run/ajenti.sock, nginx returns 502 bad gateway.
I checked nginx's error log, and it shows:

upstream prematurely closed connection while reading response header from upstream, client: X.X.X.X, server: domain.net, request: "GET / HTTP/1.1", upstream: "http://unix:/var/run/ajenti.sock:/", host: "domain.net"

Any suggestions?