When using a dual-stack server, ‘localhost’ is ambiguous, it can be 127.0.0.1 (IPv4) or ::1 (IPv6). Specifying localhost in production.yaml gets interpreted as the v4 address, but the resolver used by nginx gets the v6 address first, leading to lots of errors like this one:
[error] 22446#22446: *29 connect() failed (111: Connection r
efused) while connecting to upstream, client: 2a03:7220:8081:6101::18, server: p
eertube.laas.fr, request: “POST /api/v1/users/token HTTP/2.0”, upstream: “http:/
/[::1]:9000/api/v1/users/token”, host: “peertube.laas.fr”, referrer: “https://pe
ertube.laas.fr/login”
One good way to avoid the problem (and probably more efficient too) would be to use a Unix socket rather than an IP one. Afaict, nginx supports this.
Would it be possible to tell peertube toblisten to a Unix socket, by specifying a path rather than a host name for instance ?