Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Nginx as a Reverse Proxy for ASP.NET Core: proxy_pass, Headers, WebSockets/SignalR and Timeouts
Since Nginx 1.29.7 upstream keepalive and HTTP/1.1 are the default, but only if you use an upstream block: proxy_pass to a direct address opens a new connection per request. We take Microsoft's reference config apart line by line and measure SignalR quietly falling back to long polling without the WebSocket upgrade map, buffering with SSE, aligning Nginx's and Kestrel's body and header limits, and telling 502 from 504 in the logs.
What's New in Real-time from .NET 8 to .NET 11: Stateful Reconnect, Native AOT, SSE and SignalR Authentication Refresh
.NET 8 brought stateful reconnect, .NET 9 polymorphic hub parameters, an ActivitySource and Native AOT for SignalR, .NET 10 TypedResults.ServerSentEvents, and .NET 11 adds authentication refresh that renews the token without dropping the connection. A 28 MB vs 82 MB AOT measurement, the strongly typed hub AOT warning, cancellable hub calls, SSE in OpenAPI 3.2 and legacy ASP.NET SignalR.
Scaling Out and Running SignalR in Production: Sticky Sessions, Redis Backplane, Azure SignalR Service and Monitoring
SignalR on multiple servers needs two things: sticky sessions that keep negotiate and the connection on the same server, and a backplane that carries messages between servers. Real error messages with Nginx, the skipNegotiation exception, the Redis backplane and its channel prefix, messages lost during a Redis outage, Azure SignalR Service, and SignalR metrics and tracing.
Resilience in SignalR: Automatic Reconnect, Stateful Reconnect, Streaming and MessagePack
Stateful reconnect prevents message loss only on short drops that recover instantly; an outage of a few seconds still means a new connection and lost messages. A retry policy with jitter, rebuilding groups in onreconnected, server and client streaming with IAsyncEnumerable, cancellation, MessagePack's byte savings and its PascalCase and date traps, and limits for slow clients.
Authentication, Authorization and Security in SignalR: JWT, the access_token Query String and Hub Method Policies
SignalR authenticates a user once, when connecting; by default the connection stays open even after the token expires or a role changes. access_token via OnMessageReceived, tokens leaking into logs, accessTokenFactory, hub and method policies, resource-based checks with HubInvocationContext, rate limiting with IHubFilter, message size, Origin, and CloseOnAuthenticationExpiration.
Users, Groups and Connection Lifecycle in SignalR: Sending Messages from Anywhere with IHubContext
Clients.User reaches all of a user's tabs, while group membership belongs to the connection and is lost on reconnect. IUserIdProvider, Caller/Others/OthersInGroup, the unexpected ordering of OnConnectedAsync and OnDisconnectedAsync, counter-based presence in Redis, and sending notifications from an endpoint, a BackgroundService and a consumer with IHubContext.
Getting Started with ASP.NET Core SignalR: Hubs, Strongly Typed Hubs and Connecting from Angular with @microsoft/signalr
A SignalR hub is a transient handler created for every call; it holds no state and reports user-facing errors with HubException. AddSignalR and MapHub, type-safe calls with Hub<IClient>, transport negotiation, encapsulating the HubConnection in an Angular service that publishes signals, and AllowCredentials with an explicit origin list.
Real-time Options: Polling, Long Polling, Server-Sent Events, WebSocket and SignalR — Which One When?
Use SSE for one-way notifications, WebSocket or SignalR for two-way low latency, and polling for rarely changing data. We build the same order status feature five ways and measure latency, request count and memory per connection; plus a decision table, where WebTransport stands, and why not everything should be real-time.