aspnet / BasicMiddleware

[Archived] Basic middleware components for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
169 stars 84 forks source link

RedirectToHttps does not support X-Forwarded-Proto #287

Closed bloritsch closed 6 years ago

bloritsch commented 6 years ago

Cloud deployments commonly terminate the encrypted HTTPS connection and reverse proxy standard HTTP to the application. You can get a redirect loop without support for the "X-Forwarded-Proto" header. This will tell you if the reverse proxy terminated HTTPS for you while still allowing you to add your rewrite rule.

I'm actually surprised that this isn't supported out of the box.

Tratcher commented 6 years ago

The intention is to handle X-Forwarded-Proto with UseForwardedHeaders so the rest of the stack doesn't need to special case it. See https://github.com/aspnet/Docs/issues/2384