Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Django (v. 1.3.1) app at http://some_other_example.com (it will be behind firewall) running on lighttpd server with fastcgi.

I need make it available under http://example.com/myapp.

It works fine except for redirects - when I login from http://example.com/myapp/login it redirects me to http://example.com instead of http://example.com/myapp. When logging-in from http://some_other_example.com/login it is ok.

My configuration:

  • apache2.conf at example.com:

    ProxyPass /myapp http://some_other_example.com
    ProxyPassReverse /myapp http://some_other_example.com
    ProxyHTMLURLMap http://some_other_example.com /myapp
    <Location /myapp>
        SetOutputFilter proxy-html
        ProxyHTMLExtended On
        ProxyHTMLURLMap  /      /myapp/
  • Apache version: 2.2.22
  • in settings.py I added USE_X_FORWARDED_HOST = True but it didn't help
share|improve this question
That is really weird. The ProxyPassReverse dirctive should rewrite all Lacation headers ... Maybe you could try adding trailing slashes? –  Christopher Perrin Jun 21 '12 at 15:49
Tried adding trailing slashes - it doesn't help. –  ml256 Jun 22 '12 at 13:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.