Closed maffinca69 closed 8 months ago
Could it be that the issue is due to IPv6? Is the result different if you pass the -6
flag to curl
? Otherwise I suspect some DNS issue, might be that the resolver in the nginx config does not know how to resolve server
.
I disabled ipv6 listening in all nginx config files, but that didn't help. I also disabled google and open-dns servers by commenting out resolver in the configuration files
I tried setting ipv6only=off, but that didn't help either
Even with seemingly disabled ipv6 curl with option -6
gives the following:
Could not resolve host: server
i can rename my server container if it's helped
UPD: response weserv:
{
"status": "error",
"code": 404,
"message": "The hostname of the origin is unresolvable (DNS) or blocked by policy."
}
So far I've solved the problem by just embedding the files I need directly into the container (everything works locally anyway) and using via /static
This is probably even better since everything works locally
I think you could make it work by setting the DNS resolver to Docker's embedded DNS server within the nginx configuration, see: https://github.com/weserv/images/issues/206#issuecomment-1752740666.
But indeed, using the weserv filter
mode (available on /static
) is probably a better solution for this.
I hope this information helped. Please feel free to re-open if questions remain.
Hi!
I have my own service that can give out pictures. For example, the address (server in docker-compose) http://localhost:81/media/image.png will return a valid and correct picture image.png But if the same address is used to get a thumbnail image, I get a 404. At the same time curl call inside weserv container successfully downloads my image
maffinca69/weserv-arm64 - image for my mac (arm) without changes