Embedded variables from ngx_http_core_module and websocket connections

Francis Daly francis at daoine.org
Wed Jul 21 21:40:21 UTC 2021


On Tue, Jul 20, 2021 at 12:39:51PM +0200, Dorin RuV wrote:

Hi there,

> I'm currently having an issue with nginx which I cannot get to the bottom
> of.

> server{
>   listen 443 ssl http2;

Does anything change if you just remove that "http2"?

>   location / {
>     proxy_http_version 1.1;
>     proxy_set_header Upgrade $http_upgrade;

"Upgrade" is a http/1.1 header, not a http/2.0 header. So for an incoming
http/2.0 request, the variable should be empty.

> It seems though that the
> $http_upgrade variable is seen as empty, even though tcpdump confirms the
> fact that the Upgrade header is correctly sent to Nginx by the client
> request.

I'm guessing that tcpdump is showing that the http/1.1 request to port
80 includes the Upgrade header; but is not showing anything about what
is in the encrypted http/2.0 request to port 443?

Cheers,

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list