Php-fpm errors (IPv6)

Operating system: Ubuntu
OS version: 20.04

Hi, I’m having an issue with the latest version of Ubuntu 20.04 and Virtualmin with LEMP stack. In Nginx error log there’s lines:

... connect() failed (111: Connection refused) while connecting to upstream, client: xxx, server: test.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://[::1]:9001" ...

This seems to happen because fpm is listening localhost. If I change the pool and nginx proxy settings from localhost to 127.0.0.1 the issue disappears. I just couldn’t find any place set configure these automatically for new servers.

The error is only in the logs, no 5xx responses.

Here’s a related thread I found: Puzzling Log messages talking to php-fpm
And a reply: Puzzling Log messages talking to php-fpm

Another option that seemed to work was disabling IPv6 completely, which obviously is not ideal.

On CentOS 8 there was a similar case, but there was just a warning in fpm logs:

WARNING: Found multiple addresses for localhost, 127.0.0.1 ignored

Any insight on this or just ignore it?

Having the same exact problem: Fpm with ipv6 address

If there’s no solution to this issue, I think I’ll have to go with this route sadly.

A quick hack is just comment out the ::1 version of localhost in /etc/hosts.

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