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

SSL Behind Proxy

Nathan Armstrong edited this page Apr 6, 2017 · 5 revisions

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 Authentication  —  Documentation overview  —  Part 24. Validation »

Clone this wiki locally