rdmorganiser / rdmo-docker-compose

RDMO running in different docker images held together by docker compose
Apache License 2.0
3 stars 12 forks source link

BASE_URL doesn't apply to all paths REVISITED #11

Closed johlton closed 3 years ago

johlton commented 3 years ago

Sorry to repeat the already closed issue #9 this but this is exactly what happens in my docker-compose installation:

The home view comes up smoothly, except for 1 problem: Most of the contained links (not all!) do not have the /rdmo/ path included. The link to the standalone sign-in form works; not working are the form action and the languag switcher and the logo link. They all do not have the BASE_PATH subdir included.

My proxy directive:

ProxyPass /rdmo http://127.0.0.1:8484/
ProxyPassReverse /rdmo http://127.0.0.1:8484/

I noticed the message _"NOTE: BASEURL does not work, will be fixed later" within the variables.env file. What is the current status for this? Might this be the reason for the problem here?

So where to go from here? Any suggestions are highly appreciated. Thanks.

johlton commented 3 years ago

To answer my own question:

Apache Config

ProxyPass        /rdmo http://localhost:8484/ nocanon
ProxyPassReverse /rdmo http://localhost:8484/
ProxyRequests    Off
AllowEncodedSlashes NoDecode

/vol/rdmo-app/config/settings/local.py

Add FORCE_SCRIPT_NAME

try:
    BASE_URL = os.environ['BASE_URL']
except KeyError:
    pass

FORCE_SCRIPT_NAME = os.environ['BASE_URL']

Hint came from: https://docs.webfaction.com/software/django/config.html#mounting-a-django-application-on-a-subpath