Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

SSL Behind Proxy

Jaxelr edited this page Nov 11, 2016 · 5 revisions

#SSL Behind Proxy

Sometimes you may be in a position where your Nancy app is behind a proxy eg/nginx which uses SSL. When the proxy routes the request to Nancy the request scheme will be http. To make it match the proxy scheme you can use SSLProxy.RewriteSchemeUsingForwardedHeaders.

In your Bootstrapper simply call SSLProxy.RewriteSchemeUsingForwardedHeaders(pipelines); in ApplicationStartup/RequestStartup and you're good to go.

NOTE Your proxy must pass in either the X-Forwarded-Proto header or the newer Forwarded header with the value proto=https inside it

[<< Part 22. Basic](Basic Authentication) - Documentation overview - [Part 24. Validation >>](Nancy And Validation)

Clone this wiki locally