dsm-reverse-proxy-websocket
dsm-reverse-proxy-websocket copied to clipboard
Changes to `proxy_set_header Connection` needed.
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
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.
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.