On Jan 19, 9:05 pm, Malcolm Tredinnick <[email protected]>
wrote:
> If the web server handling the Django requests is not the external web
> server, but is proxied for by some other server (e.g. Apache facing the
> outside world, passing off requests to a particular URL prefix to some
> other webserver that is doing the Django work), it might be that the
> internal connection between external web server and django-handling
> webserver is only HTTP, not HTTPS. In that case, Django thinks the
> request is an HTTP request and constructs the absolute URL
> appropriately.
>
> This situation isn't uncommon when using fastcgi, for example.

Yes, that's just what I've got set up - lighttpd with Apache front end
via fastcgi.

I configured Apache with "ProxyPass / http://127.0.0.1:${LIGHTTPD_PORT}";...
so come to think of it, it's not surprising that lighttpd is unaware
of an SSL connection that doesn't terminate upon it.

>
> In that sort of situation, it is the responsibility of the external
> webserver to rewrite any outgoing URLs correctly for the external world.
> Thus, it should know that it is converting an incoming HTTPS request to
> an HTTP request and thus convert any URLs for the local hostname back
> again before replying. In Apache, for example, this is often done with
> the ProxyPassReverse directive in the mod_proxy module.

The gentleman wins a large stuffed bear!  I cleverly neglected to
configure the ProxyPassReverse directive... as I said, I'm not the
sharpest knife in the drawer.  Rectifying this clears up the problem.

Thanks very much for the clear explanation; the education is
appreciated.

>The
> ProxyPassReverseCookieDomain and related directives also need to be at
> considered, depending upon how much rewriting is done.

Well you've pointed me in the direction of the right things to study,
but if I could prevail upon you to consider briefly aloud the best
configuration of these directives in the fastcgi setup I've got going,
I'd certainly be much obliged.

Thanks again!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to