Configuring Sticky Sessions vs Forwarded Headers - Blazor Server

Ryan Buening 26 Reputation points
2021-04-12T18:25:55.263+00:00

I'm running a Blazor Server app behind a load balancer. I am aware that sticky sessions can be used with ASP.NET Core when SignalR is running behind a load balancer.

I have also read documentation that talks about using forwarded headers.

My question is, if forwarded headers are used, are sticky sessions still required? Or are these two strategies meant to be used together?

Without sticky sessions enabled, I receive the following error:

86988-image.png

This error is resolved when using sticky sessions. I'm wondering if configuring forwarded headers would fix this as well without the need of sticky sessions.

Developer technologies ASP.NET ASP.NET Core
Developer technologies .NET Blazor
{count} votes

Accepted answer
  1. Fei Xue - MSFT 1,111 Reputation points
    2021-04-29T03:01:31.173+00:00

    Configuring forwarded headers won't fix this issue as it only resolve the problems list below:

    • When HTTPS requests are proxied over HTTP, the original scheme (HTTPS) is lost and must be forwarded in a header.
    • Because an app receives a request from the proxy and not its true source on the Internet or corporate network, the originating client IP address must also be forwarded in a header.

    The sticky session resolve the different problem that make sure a specific connection be handled by the same server process.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.