Update: I've changed application to _application, and added tabs to
the last two lines:
import os, sys
sys.stdout = sys.stderr
sys.path.insert(1,'/home/mydomain/www/mydomain.com/')
sys.path.insert(2,'/home/mydomain/www/mydomain.com/mydomainmain/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mydomainmain.settings'
os.environ['PYTHON_EGG_CACHE'] = '/home/mydomain/www/
mydomain.com/.python-eggs'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
import mydomainmain.monitor
mydomainmain.monitor.start(interval=1.0)
def application(environ, start_response):
environ['wsgi.url_scheme'] = environ.get('HTTP_X_URL_SCHEME', 'http')
return _application(environ, start_response)
No internal server error anymore, but django error message says I have
a KeyError for 'HTTP_X_FORWARDED_HOST'. I'm going from an http page
to a payment ui that should be https.
Chip
On Jan 24, 4:11 pm, ckohrman <[email protected]> wrote:
> I came across Graham's solution to get https to work with mod_wsgi,
> nginx, and
> django:http://groups.google.com/group/modwsgi/browse_frm/thread/94f952720c87...
>
> I added this line to nginx vhost.conf:
> proxy_set_header X-Proxy-Host $proxy_host;
>
> But I got an Internal Server Error message when I added the code to my
> wsgi file. If you have a second, could you please skim my wsgi entry
> for any obvious error:
>
> import os, sys
> sys.stdout = sys.stderr
> sys.path.insert(1,'/home/mydomain/www/mydomain.com/')
> sys.path.insert(2,'/home/mydomain/www/mydomain.com/mydomainmain/')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'mydomainmain.settings'
> os.environ['PYTHON_EGG_CACHE'] = '/home/mydomain/www/
> mydomain.com/.python-eggs'
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
> import mydomainmain.monitor
> mydomainmain.monitor.start(interval=1.0)
>
> def application(environ, start_response):
> environ['wsgi.url_scheme'] = environ.get('HTTP_X_URL_SCHEME', 'http')
> return _application(environ, start_response)
>
> I'm lost, and I'd appreciate any help you can offer.
>
> Apache/2.2.15 (Unix)
> mod_ssl/2.2.15
> OpenSSL/0.9.8e-fips-rhel5
> mod_wsgi/3.3
> Python/2.7
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en.