<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Le lun. 9 févr. 2026 à 21:49, Gabriel Corona <<a href="mailto:gabriel.corona@free.fr">gabriel.corona@free.fr</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> > Changing $http_host with $host resolves the issue, and is more<br>
 > futureproof.<br>
<br>
I agree that using $host is more correct than $http_host.<br>
<br>
Warning: however this could possibly introduce a regression if your <br>
backend application need to use the port information. $host does not <br>
include the port while $http_host typically does.<br>
<br>
(Since NGINX 1.29.3, we can use $host$is_request_port$request_port but <br>
this not available in trixie.)<br>
<br>
> Currently, HTTP/3 is broken with a HTTP/1.1 backend. As there is no Host<br>
> header in HTTP/3 (the name is sent during the negociation and not as a<br>
> header), the backend is refusing the request.<br>
<br>
I'm wondering if this is not a bug in NGINX handling of HTTP/3 requests.<br></blockquote><div><br></div><div>Right, the correct full answer is "this is done on purpose":</div><div><a href="https://github.com/nginx/nginx/pull/917#issuecomment-3378335444">https://github.com/nginx/nginx/pull/917#issuecomment-3378335444</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
When I am submiting a HTTP/2 request with ":authority" and no "Host" <br>
header field (using Node.js http2 module), the $http_host variable is <br>
properly populated:<br>
<br>
~~~<br>
:method = GET<br>
:path = /<br>
:authority = <a href="http://127.0.0.1:8000" rel="noreferrer" target="_blank">127.0.0.1:8000</a><br>
<br>
:status: 200<br>
server: nginx/1.29.3<br>
date: Mon, 09 Feb 2026 20:46:29 GMT<br>
content-type: application/octet-stream<br>
content-length: 46<br>
<br>
host = 127.0.0.1<br>
http_host = <a href="http://127.0.0.1:8000" rel="noreferrer" target="_blank">127.0.0.1:8000</a><br>
~~~<br>
<br>
Node.js code:<br>
<br>
~~~<br>
const http2 = require('node:http2');<br>
<br>
const url = process.argv[2];<br>
const authority = process.argv[3];<br>
const host = process.argv[4];<br>
<br>
const client = http2.connect(url);<br>
const method = "GET";<br>
const path = "/";<br>
const params = {<br>
   ':method': method,<br>
   ':path': path,<br>
};<br>
if (authority != null && authority != "")<br>
     params[":authority"] = authority;<br>
if (host != null && host != "")<br>
     params["host"] = host;<br>
<br>
for (const k in params) {<br>
   console.log(k + " = " + params[k]);<br>
}<br>
console.log("")<br>
<br>
const req = client.request(params);<br>
<br>
let data = ""<br>
req.on('response', (headers, flags) => {<br>
   for (const name in headers) {<br>
     console.log(`${name}: ${headers[name]}`);<br>
   }<br>
});<br>
req.on('data', (chunk) => { data += chunk; });<br>
req.on('end', () => {<br>
   console.log(`\n${data}`);<br>
   client.close();<br>
   process.exit(0);<br>
});<br>
~~~<br>
<br>
NGINX configuration:<br>
<br>
~~~<br>
server {<br>
     listen 8000 default;<br>
     http2 on;<br>
     location / {<br>
       return 200 "host = $host\r\nhttp_host = $http_host\r\n";<br>
     }<br>
}<br>
~~~<br>
<br>
Gabriel<br>
<br>
<br>
_______________________________________________<br>
Pkg-nginx-maintainers mailing list<br>
<a href="mailto:Pkg-nginx-maintainers@alioth-lists.debian.net" target="_blank">Pkg-nginx-maintainers@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-nginx-maintainers" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-nginx-maintainers</a><br>
</blockquote></div></div>