See
https://openlitespeed.org/kb/setup-openlitespeed-as-a-websocket-proxy/
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have Openlitespeed installed on my CentOS server.
I deployed a Blazor app to the server after installing dotnet core. The Blazor code runs fine but I cannot get the Websocket to work.
If I look in console, I see that the Blazor application loads but the WebSocket cannot connect with no further error details.
I created this Blazor app by starting the blazor application on port 5000 and created an external app in OpenLiteSpeed as a web server. I then created a virtual host in OLS for my Blazor application.
If I go to the Virtual Host for my website, I can visit the website fine. However, if I look in console, I get an error that Blazor cannot establish a websocket connection to my domain. I tried adding port 80
to the 'Websockets' section of OLS but that made the website unable to load. I then added port 5000
to the websockets section but that didn't resolve the issue either and I received the same error.
If I run the application with Visual Studio on my local computer, the websocket connects fine. However, if I deploy the app to my remove CentOS server, it does not connect properly. My startup script for CentOS looks like this (assume I changed mywebsite.com):
[Unit]
Description=ASP.NET Blazor App
[Service]
WorkingDirectory=/home/mywebsite.com/public_html
ExecStart=/usr/bin/dotnet /home/mywebsite.com/public_html/testapp.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=dotnet-example
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target
How do I fix this?