Opened 2 years ago

Closed 2 years ago

#2261 closed defect (worksforme)

A case of Connection: keep-alive, Upgrade

Reported by: xinyanglbeijing@… Owned by:
Priority: blocker Milestone:
Component: nginx-module Version: 1.14.x
Keywords: Cc: xinyanglbeijing@…
uname -a: Chrome
GET /cassis/endpoint?service=datacache HTTP/1.1
Host: srd-qualif.chu-dijon.local
Connection: Upgrade <------------------
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36
Upgrade: websocket
Origin: http://srd-qualif.chu-dijon.local
Sec-WebSocket-Version: 13
Accept-Encoding: gzip, deflate
Accept-Language: en
Cookie: JSESSIONID=3AF65B64EB0DEB65771229A34E3674E8
Sec-WebSocket-Key: 59PzFSuvIb1/E060EY+tQQ==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
nginx -V: nginx version: nginx/1.14.0

Description (last modified by xinyanglbeijing@…)

nginx -v
1.14

kernel
Linux ubuntu1804-dev-server-xinyang 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Description:
This case happened when I used firefox to get a websocket connection.
If I uses chrome that works well.

Below is the http traffic.

Chrome (Works)
GET URL HTTP/1.1
Host: host
Connection: Upgrade <------------------ upgrade is in a separated line
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36
Upgrade: websocket
Origin: URI
Sec-WebSocket-Version: 13
Accept-Encoding: gzip, deflate
Accept-Language: en
Cookie: XXX
Sec-WebSocket-Key: XXXX
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

===========================================================================

Firefox (doesn't work)
GET URI HTTP/1.1
Host: host
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Sec-WebSocket-Version: 13
Origin: XXXX
Sec-WebSocket-Extensions: permessage-deflate
Sec-WebSocket-Key: XXXX
DNT: 1
Connection: keep-alive, Upgrade <------------------------- Here multiple values are in one line
Cookie: XXXX
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket

Change History (2)

comment:1 by xinyanglbeijing@…, 2 years ago

Description: modified (diff)

comment:2 by Maxim Dounin, 2 years ago

Resolution: worksforme
Status: newclosed

For nginx, contents of the Connection header does not matter. You may want to check your configuration to make sure it doesn't try to check the Connection header. Alternatively, consider re-configuring websocket proxying as per WebSocket proxying how-to article. With proper configuration websocket proxying is known to work with both Chrome and Firefox. If it doesn't work for you, there might be something with your websocket server.

If you need further help with configuring nginx, consider using support options available.

Note: See TracTickets for help on using tickets.