On Jul 20, 5:29 pm, Christoph Zwerschke <
c...@online.de> wrote:
> Damjan schrieb:
>
> > Are you proxy-ing?
> > You probably need a SCRIPT_NAME fix WSGI middleware like this :
>
> This already exists as part of paste.deply; you only need to add it to
> your config file:
>
>
http://pythonpaste.org/deploy/class-paste.deploy.config.PrefixMiddlew...
>
> (Btw, in TG1 it was only one config setting, server.webpath).
>
> If you're using mod_wsgi instead of mod_proxy, then I think you can do
> this with the WSGIScriptAlias directive.
For mod_wsgi things should just work properly to begin with, there
should be no need to fiddle with SCRIPT_NAME and PATH_INFO provided
that TG2 is doing the correct thing and honouring SCRIPT_NAME as the
mount point. The TG2 application also has to ensure that it uses the
correct functions for constructing absolute URLs for the same
application when doing redirects etc.
The only time where one may need to do a fixup when using mod_wsgi is
where using AddHandler and trying to get a .wsgi file to appear as
being at root of web site. In this case you need a Apache rewrite rule
and a WSGI wrapper to truncate SCRIPT_NAME appropriately. This is
described in mod_wsgi configuration guidelines documentation.
The problem with using mod_proxy is that you loose information between
the front end and back end where mount point in each is different.
That is, where front end mounts at sub URL but front end is all setup
to mount at root. The back end should really be mounting at sub URL as
well in that case, but often this isn't done.
Graham