diff --git a/.github/workflows/podman.yml b/.github/workflows/podman.yml index fbb3b9df1..5f58d7fbd 100644 --- a/.github/workflows/podman.yml +++ b/.github/workflows/podman.yml @@ -15,6 +15,7 @@ jobs: AML_CORS_ORIGIN_WHITELIST: ${{ vars.AML_CORS_ORIGIN_WHITELIST }} AML_DEBUG: ${{ vars.AML_DEBUG }} AML_LOCATION_PROVIDER: ${{ vars.AML_LOCATION_PROVIDER }} + AML_SUBPATH: ${{ vars.AML_SUBPATH }} DJANGO_SETTINGS_MODULE: ${{ vars.DJANGO_SETTINGS_MODULE }} SQL_DATABASE: ${{ vars.SQL_DATABASE }} SQL_HOST: ${{ vars.SQL_HOST }} diff --git a/backend/aml/production_settings.py b/backend/aml/production_settings.py index 24bb4dfa4..7ff840b8c 100644 --- a/backend/aml/production_settings.py +++ b/backend/aml/production_settings.py @@ -6,7 +6,11 @@ # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases -STATIC_URL = '/django_static/' +# Make sure Django runs on subpath /server +FORCE_SCRIPT_NAME = '/server' +STATIC_URL = FORCE_SCRIPT_NAME + STATIC_URL +USE_X_FORWARDED_HOST = True +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') DATABASES = { 'default': { diff --git a/docker-compose-deploy.yml b/docker-compose-deploy.yml index eb90cfbce..f0d4f0d38 100644 --- a/docker-compose-deploy.yml +++ b/docker-compose-deploy.yml @@ -44,6 +44,7 @@ services: - AML_CORS_ORIGIN_WHITELIST=${AML_CORS_ORIGIN_WHITELIST} - AML_LOCATION_PROVIDER=${AML_LOCATION_PROVIDER} - AML_SECRET_KEY=${AML_SECRET_KEY} + - AML_SUBPATH=${AML_SUBPATH} - DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE} - DJANGO_SUPERUSER_USERNAME=${DJANGO_SUPERUSER_USERNAME} - DJANGO_SUPERUSER_EMAIL=${DJANGO_SUPERUSER_EMAIL}