Skip to content

Instantly share code, notes, and snippets.

@ncole458
Created February 25, 2016 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ncole458/c139ea983790ce114246 to your computer and use it in GitHub Desktop.
Save ncole458/c139ea983790ce114246 to your computer and use it in GitHub Desktop.
Django & Nginx w/Gunicorn full https
# Forward all to https for Django / DRF viewsets
# settings.py
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
# Nginx location header (see also http://nginx.org/en/docs/http/configuring_https_servers.html)
location / {
# ...
proxy_set_header X-Forwarded-Protocol $scheme;
# ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment