private static bool IsSsl(string scheme, NameValueCollection headers) { if (scheme == Uri.UriSchemeHttps) { return true; } // if this header is set then we nginx proxied return !string.IsNullOrEmpty(headers[ProxySslModeHeader]); }