Issue #755 resolved

SSL Redirect Loop/Errors When Running nginx+SSL As Proxy To Apache+WSGI

Anonymous created an issue

The following solution, as proposed by [http://www.fairviewcomputing.com/blog/2008/10/23/django-wsgi-handler-ssl-proxies/ Graham Dumpleton], resolved my issue of SSL redirect loops while running nginx+ssl as a proxy to apache+wsgi.

In your nginx.conf file you need to have: {{{ proxy_set_header X-Url-Scheme $scheme; }}} While your WSGI wrapper looks something like this: {{{ import os, sys

apache_configuration= os.path.dirname(file) project = os.path.dirname(apache_configuration) workspace = os.path.dirname(project) sys.path.append(workspace)

os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'

import django.core.handlers.wsgi

_application = django.core.handlers.wsgi.WSGIHandler()

def application(environ, start_response): environ['wsgi.url_scheme'] = environ.get('HTTP_X_URL_SCHEME', 'http') return _application(environ, start_response) }}}

Others may find this information if it is included in the installation hints.

Reported by trevor.ochocki

Comments (1)

  1. Log in to comment