I'm trying to set up an Apache reverse proxy for a django app that is 
running in a singularity container.  I'm also trying to enforce HTTPS on 
the Apache frontend.

I've tried the following in my apache conf.d/app.conf:

ProxyPreserveHost OnRequestHeader set X-Forwarded-Proto 'https' 
env=HTTPSProxyPass "/app_prefix/"  "http://localhost:8101/"ProxyPassReverse 
"/app_prefix/"  "http://localhost:8101/";

I've tried using the following in the mysite/sittings (django):

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
USE_X_FORWARDED_HOST = True
FORCE_SCRIPT_NAME = '/app_prefix/'

None of these seem to work.

Here's how I'm starting the django app:

/software/singularity/bin/singularity exec -B /basedir:/mnt 
/basedir/container.simg /mnt/bin/run_in_singularity.sh

The 'run_in_singularity.sh' is as follows:

cd /mnt/simple-ajax-crud/
python manage.py runserver 0.0.0.0:8101

The app loads, but the app isn't creating relative URLs, so includes are 
referenced under /static (which can't be found b/c it doesn't match the 
proxy/reverse proxy).

If I work around '/static' by adding additional reverse proxies, then I run 
into other URLs in the app with the same problem. So I need to figure out 
how to inform the app to create the correct URLs.


Can anyone help?


Thanks, Brian

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/247cf1c4-5ccb-40db-9545-68ae5714c4f1%40googlegroups.com.

Reply via email to