The problem is related to the purging ACL in your VCL file. Apparently the client IP doesn't match any IP address in the ACL.
This somewhat makes sense, because Varnish doesn't receive the actual client IP address, because Nginx is jammed in between as a TLS proxy.
Please share your full VCL file, including the purging ACL.
Potential solutions
- Modify the VCL to use the value of the
X-Forwarded-For
header instead of client.ip
- Add the port of Varnish server to the IP address of your
--http-cache-hosts
parameter.
The 2nd solution is probably the easiest one because it doesn't require a lot of effort. If Varnish runs on port 6081
for example, your config command could look like this:
bin/magento setup:config:set --http-cache-hosts=127.0.0.1:6081
This will ensure that Varnish receives the purges directly, rather than through ports 80
or 8080
that are configured by Nginx.
See https://devdocs.magento.com/guides/v2.4/config-guide/varnish/use-varnish-cache.html for more information.