Configure NGINX / Varnish for SignalR Websites?

I use NGINX to offload SSL, and then using varnish to load balance / cache responses from IIS8.

i.e. ssl -> nginx -> varnish -> iis8

It works great. SignalR using a long poll works fine - all my timeouts, etc. Configured correctly.

Now I'm trying to get SignalR and websockets to work with this config; to no avail. To simplify things, I tried the following two settings:

None of these works. I keep getting this error in Chrome:

Connection to WebSocket with 'ws: // xxxxxxxx' failed: Unexpected response code: 500

and this is from IIS:

System.InvalidOperationException: Not a valid web socket request.
   at Microsoft.AspNet.SignalR.Owin.ServerRequest.AcceptWebSocketRequest(Func`2 callback)
   at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
   at Microsoft.AspNet.SignalR.Owin.CallHandler.Invoke(IDictionary`2 environment)
   at Microsoft.Owin.Host.SystemWeb.OwinCallContext.Execute()
   at Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.BeginProcessRequest(HttpContextBasehttpContext, AsyncCallback callback, Object extraData)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Owin.Host.SystemWeb.CallContextAsyncResult.End(IAsyncResult result)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

, - IIS, IIS -. - ?

+4

All Articles