代码之家  ›  专栏  ›  技术社区  ›  TheUnexpected

lighttpd未通过HTTP/2发送

  •  0
  • TheUnexpected  · 技术社区  · 5 年前

    我在Raspberry Pi 2上的Raspbian Stable上,我已经编译了自己的lighttpd版本1.4.59 is supposed to have HTTP/2 enabled by default .

    安装后,一切似乎都正常:

    pi@Raspi:~ $ lighttpd -V
    lighttpd/1.4.59 - a light and fast webserver
    
    Event Handlers:
    
            + select (generic)
            + poll (Unix)
            + epoll (Linux)
            - /dev/poll (Solaris)
            - eventports (Solaris)
            - kqueue (FreeBSD)
            - libev (generic)
    
    Network handler:
    
            + linux-sendfile
            - freebsd-sendfile
            - darwin-sendfile
            - solaris-sendfilev
            + writev
            + write
            - mmap support
    
    Features:
    
            + IPv6 support
            + zlib support
            - zstd support
            - bzip2 support
            - brotli support
            + crypt support
            - OpenSSL support
            - mbedTLS support
            - NSS crypto support
            - GnuTLS support
            - WolfSSL support
            - Nettle support
            + PCRE support
            - MySQL support
            - PgSQL support
            - DBI support
            - Kerberos support
            - LDAP support
            - PAM support
            - memcached support
            - FAM support
            - LUA support
            - xml support
            - SQLite support
            - GDBM support
    

    但这些页面似乎仍然通过“http/1.1”传输。当我从服务器获取一个简单的PHP页面时,我期待着“h2”:

    HTTP/1.1 200 OK
    Content-type: text/html; charset=UTF-8
    Content-Length: 99966
    Date: Tue, 09 Feb 2021 23:51:52 GMT
    Server: lighttpd/1.4.59
    

    enter image description here

    0 回复  |  直到 5 年前
        1
  •  1
  •   gstrauss    5 年前

    @意外情况:如果客户端发出HTTP/1.1请求,则lighttpd会将其作为HTTP/1.1请求处理。你可以用 mod_accesslog 将请求记录到访问日志,或 debug.log-request-header = "enable" 如果您的客户端正在发出HTTP/1.1请求,或者HTTP/2已协商,则将lighttpd日志转换为错误日志。

    看见 man curl 明确地 --http2 和 --http2-prior-knowledge 命令行选项,即使目标是http而不是https。

    推荐文章