Creating a socket file

I want to use Caddy v2.7.6 on FreeBSD 14 for load balancing.
I have used nullfs to mount the socketfiles of two databases that are in their own jail in the jail where Caddy is located.
Here is the configuration of Caddyfile:

unix//var/run/postgresql/DB./s.PGSQL.5432 {
  reverse_proxy unix//var/run/postgresql/DB1/.s.PGSQL.5432 unix//var/run/postgresql/DB2/.s.PGSQL.5432 {
    lb_try_duration 3s
    lb_policy first

Unfortunately, I cannot find a socket file in /var/run/postgresql/DB./.
Can Caddy create a socket file?

Caddy is an HTTP server. I don’t think PostgreSQL uses HTTP, it’s a different TCP protocol.

You’d need to use something like GitHub - mholt/caddy-l4: Layer 4 (TCP/UDP) app for Caddy to proxy TCP traffic.

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