Welcome! Log In Create A New Profile

Advanced

Empty host header on http 1.1 results in invalid host header logging in error.log

Bart Warmerdam
July 22, 2015 12:54AM
Hello,

Why does nginx logs an info log a message like ...client sent invalid
host header while reading client request headers... request: "GET
/keepalive.html HTTP/1.1", host: ""
if the host header is empty. According to the http 1.1 specification it
is legal to send an empty host header so it should not log this message
since the header is not invalid. So the requests contains the host
header but without a value. The call also results in a 400 instead of a
2xx or 3xx response.

Regards,

B.


curl -v -H "Host: " http://someserver/keepalive.html
* Trying xx.xx.xx.xx...
* Connected to someserver (xx.xx.xx.xx) port 80 (#0)
> GET /keepalive.html HTTP/1.1
> Host:
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 400 Bad Request
< Date: Wed, 22 Jul 2015 04:50:51 GMT
< Content-Type: text/html
< Content-Length: 1214
< Connection: close
< ETag: "55ae9a88-4be"
<

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Empty host header on http 1.1 results in invalid host header logging in error.log

Bart Warmerdam 3051 July 22, 2015 12:54AM

Re: Empty host header on http 1.1 results in invalid host header logging in error.log

Maxim Dounin 1102 July 22, 2015 02:20PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 162
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready