Project

General

Profile

[Solved] Difficulty Enabling HTTP/2 on lighttpd?

Added by juicey about 3 years ago

In the latest version of lighttpd, I read that http/2 is enabled by default. When I try to send a request, it says 505 http version not supported. I did some more digging and found that in the previous dev build you would have to enable it.
Here is my config

server.feature-flags += ("server.h2proto" => "enable")


It still does not work.
How can I enable http2?


Replies (5)

RE: Difficulty Enabling HTTP/2 on lighttpd? - Added by avij about 3 years ago

Are you using plain http or https? I haven't checked, but I would guess HTTP/2 would only be enabled by default for https.

If you want HTTP/2 with plain HTTP, you may need

server.feature-flags += ("server.h2c" => "enable")

RE: Difficulty Enabling HTTP/2 on lighttpd? - Added by gstrauss about 3 years ago

The latest version of lighttpd is lighttpd 1.4.59, and HTTP/2 is enabled over TLS, via upgrade: h2c, and via prior knowledge.

You can test with curl
curl -v --http2 https://127.0.0.1/
curl -v --http2 http://127.0.0.1/
curl -v --http2-prior-knowledge http://127.0.0.1/

juicey, you should check what version of lighttpd you are running: lighttpd -v

In lighttpd 1.4.56 through lighttpd 1.4.58, you need to enable server.feature-flags += ("server.h2proto" => "enable") to enable HTTP/2 over TLS.

You must enable both: server.feature-flags += ("server.h2proto" => "enable", "server.h2c" => "enable") to enable HTTP/2 cleartext (Upgrade: h2c and prior-knowledge)

RE: [Solved] Difficulty Enabling HTTP/2 on lighttpd? - Added by juicey about 3 years ago

Is it possible to do a http2 server push with lighttpd?

RE: [Solved] Difficulty Enabling HTTP/2 on lighttpd? - Added by gstrauss about 3 years ago

Is it possible to do a http2 server push with lighttpd?

Not currently. I suggest using the Link response header for a similar purpose.

    (1-5/5)