2

Description of problem

I am unable to get the static files to load when running KiwiTcms via docker in a subdirectory. ex: www.mysiteweb.com/kiwi with a reverse proxy (nginx)

As suggested in the docs, i made a local_setting.py file. It contains the following:

MEDIA_URL = '/kiwi/uploads/'
STATIC_URL = '/kiwi/static/'

Actual results

The path seems to be correct, ex: https://www.mysiteweb.com/kiwi/static/patternfly/dist/js/patternfly.min.js, but it fails do load. Give me 404.

Expected results

Run kiwi in a subdirectory: www.mysiteweb.com/kiwi and have the static files loading correctly.

Additional info

I use the default docker-compose.yml config as a base, but use my own database. (i've been able to perform the shema migration successfully).

I changed the base_url directly in the database to https://www.mysiteweb.com/kiwi

Here is my current nginx configuration: It is proxying correctly

#kiwi // port 8005                                                                                                                                                                          location /kiwi {
proxy_pass  http://localhost:8005;
proxy_set_header    Host                $http_host;
proxy_set_header    X-Real-IP           $remote_addr;
proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
proxy_set_header    X-Forwarded-Proto $scheme;
}

Here is my docker-compose.yml

version: '2'

services:

    web:
        container_name: kiwi_web
        restart: always
        image: kiwitcms/kiwi:latest
        ports:
            - 8005:8443
        volumes:
            - /data/kiwitcms/Kiwiuploads:/Kiwi/uploads:Z
            - ./local_settings.py:/venv/lib64/python3.6/site-packages/tcms/settings/local_settings.py
        environment:
            KIWI_DB_HOST: 172.17.0.1
            KIWI_DB_PORT: 3306
            KIWI_DB_NAME: kiwi
            KIWI_DB_USER: kiwi
            KIWI_DB_PASSWORD: XXXXXXXX
  • Can you trace access & redirects for static files? You don't provide enough information but it could be that the app behind the proxy is trying to access its static files and either hitting the wrong location or redirection for /static/ doesn't work correctly. – Alexander Todorov Sep 18 '19 at 10:25

0 Answers0