I'm trying to run unbound DoH behind nginx but I'm getting a 502 Bad Gateway error.
In nginx log I have the following message:
2021/03/25 08:54:49 [error] 10052#10052: *1 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: , request: "GET /dns-query?dns=AAABAAABAAAAAAABBXBlcmR1A2NvbQAAAQABAAApEAAAAIAAAAA HTTP/2.0", upstream: "https://10.0.159.133:443/dns-query?dns=AAABAAABAAAAAAABBXBlcmR1A2NvbQAAAQABAAApEAAAAIAAAAA", host: "127.0.0.1"
and unbound show only that:
[1616662996] unbound[28782:1] debug: comm point start listening 71 (30000 msec)
[1616662996] unbound[28782:1] debug: startlistening 71 mode r
[1616662996] unbound[28782:1] debug: SSL connection ip4 10.0.159.35 port 41552 (len 16)
[1616662996] unbound[28782:1] debug: comm_point_close of 71: event_del
[1616662996] unbound[28782:1] debug: close fd 71
I have the following nginx configuration:
location /dns-query {
proxy_ssl_verify off;
proxy_pass https://unbound-host;
}
What am I missing?