Caddy2 listen on unix socket

Is it possible for caddy2 to listen on unix socket? ( not proxy-ing to unix socket )

I have haproxy in front of caddy2 and i want to use unix socket instead of tcp port, is that possible?

1 Like

Hi @Dejan_Milosevic! Welcome around

Yes, Caddy 2 can listen on Unix sockets. The listen key in the JSON config takes something known as network address. The network address is of the form network/address, where in your case the network is unix. So your config value will be something like this:

unix//path/to/unix/socket

3 Likes

Oops! Be careful if you are using beta 15. beta 15 has a bug:
https://github.com/caddyserver/caddy/issues/3101

Only on the reverse proxy. Already fixed too.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.