<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi,</p>
<p>I don't have any experience with nginx for DNS, but when things
aren't working, the best thing to do is disable proxy-protocol on
all and see if it works. Then add proxy-protocol after.</p>
<p>My guess is you need to put proxy_protocol on; in upstream dns to
tell nginx to talk to it's backend.<br>
</p>
<p>Have a good day,</p>
<p> Leen.<br>
</p>
<div class="moz-cite-prefix">On 26-03-2023 22:23, VPN Технологии via
Unbound-users wrote:<br>
</div>
<blockquote type="cite"
cite="mid:a055574b-bf87-7fdb-68b5-639df06bfa5c@riseup.net">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<p> </p>
<div class="moz-text-html" lang="x-unicode">
<p><font size="4">Hello, I was trying to set up a DoT ->
nginx -> unbound scheme but encountered some errors.
Below is the configuration of the servers and the errors
they output to the logs. What could be the problem?<br>
</font></p>
<p><font size="4"><br>
</font></p>
<p><font size="4">unbound: 1.17.1</font></p>
<p><font size="4">nginx: 1.22.1<br>
</font></p>
<p><font size="4">OS: 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1
(2023-01-21) x86_64 GNU/Linux</font></p>
<p><br>
</p>
<p>nginx config:</p>
<p>stream {<br>
upstream dns {<br>
zone dns 64k;<br>
server [::1]:853;<br>
}<br>
<br>
server {<br>
listen <ext_ipv4>:853 ssl;<br>
listen <ext_ipv6>:853 ssl;<br>
ssl_certificate fullchain.pem;<br>
ssl_certificate_key privkey.pem;<br>
proxy_pass dns;<br>
proxy_protocol on;<br>
}<br>
}</p>
<br>
<p>unbound config:<br>
</p>
<p>server:<br>
access-control: 0.0.0.0/0 allow<br>
access-control: ::/0 allow<br>
interface: ::1@853<br>
proxy-protocol-port: 853</p>
<p><br>
</p>
<p>unbound log:</p>
<p>error: proxy_protocol: could not parse PROXYv2 header<br>
</p>
<p>nginx log:</p>
<p>SSL_shutdown() failed (SSL: error:14094123:SSL
routines:ssl3_read_bytes:application data after close notify)
while proxying connection, client: <client_ipv4>,
server: <server_ipv4>:853, upstream: "[::1]:853", bytes
from/to client:0/0, bytes from/to upstream:0/0<br>
</p>
<p><br>
</p>
</div>
</blockquote>
</body>
</html>