dsm-reverse-proxy-websocket icon indicating copy to clipboard operation
dsm-reverse-proxy-websocket copied to clipboard

Changes to `proxy_set_header Connection` needed.

Open SX86 opened this issue 6 years ago • 2 comments

Issue: I found that using proxy_set_header Connection "upgrade"; would cause the following error on some reverse proxy'd web apps.

Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Requests with 'Connection: Upgrade' cannot have content in the request body.

Suggested change: Use proxy_set_header Connection $http_connection; instead.

So far, the results look similar, if not the same same, and I am no longer getting the above error.

Source of the fix: https://github.com/aspnet/KestrelHttpServer/issues/1263

SX86 avatar Sep 26 '18 14:09 SX86

Will proxy_set_header Connection $connection_upgrade; works too? As this is the default value set for Connection header in latest DSM to handle Websocket, I would prefer to change to $connection_upgrade if it works the same as $http_connection for your need.

orobardet avatar Sep 26 '18 17:09 orobardet

I would have to test and see. I'm not even sure how the whole thing works, I just know that this simple change fixed an error I was getting for one particular web app.

Let me know if you need me to test it, or for me to give you more context on that specific issue.

SX86 avatar Sep 26 '18 17:09 SX86