Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx can't resolve hostname because of hardcoded dns resolver in nginx.conf #34

Open
nyarau opened this issue Oct 5, 2023 · 1 comment

Comments

@nyarau
Copy link

nyarau commented Oct 5, 2023

Currently a hard coded resolver address 127.0.0.11 is set in nginx.conf
It works in typical Docker setup, however it fails in setups using Podman with an implicit IPAM

piped-nginx     | 2023/10/05 09:33:20 [error] 31#31: recv() failed (111: Connection refused) while resolving, resolver: 127.0.0.11:53
piped-nginx     | 2023/10/05 09:33:24 [error] 30#30: *1 piped could not be resolved (110: Operation timed out), client: 10.11.8.1, server: piped-api.example.com, request: "GET /channel/UCBR8-60-B28hp2BmDPdntcQ HTTP/1.1", host: "piped-api.example.com"

Referring to https://stackoverflow.com/a/31864024 , I removed resolver line in nginx.conf and used the following config as pipedapi.conf, which indeed fixed the issue.

proxy_cache_path /tmp/pipedapi_cache levels=1:2 keys_zone=pipedapi:4m max_size=2g inactive=60m use_temp_path=off;

upstream pipedapi {
    server piped:8080;
}
server {
    listen 80;
    server_name piped-api.example.com;

    location / {
        proxy_cache pipedapi;
        proxy_pass http://pipedapi;
        proxy_http_version 1.1;
        proxy_set_header Connection "keep-alive";
    }
}
@Bnyro
Copy link
Member

Bnyro commented May 23, 2024

I think that's a reasonable change, can you please create a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants