Setting up Django application on lighttpd behind apache reverse proxy
- by ml256
I have a Django 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/
</Location>
in settings.py I added USE_X_FORWARDED_HOST = True but it didn't help