Expose Mayan on a specific domain and a base path

Hello,

I am trying to define a specific domain (http://dev.local/mayan) for my local Mayan instance (and later on production environment) by setting :

  • ORGANIZATIONS_INSTALLATION_URL: “http://dev.local
  • ORGANIZATIONS_URL_BASE_PATH: “mayan”

I found this gitlab ticket regarding the same issue “Make mayan-edms work in a subdirectory (#1002) · Issues · Mayan EDMS / Mayan EDMS · GitLab”, but it didn’t help, the static files are not displayed when I try to access the frontend even trying to set the STATIC_FILE parameter.

Do you have any idea what I am doing wrong?

FYI, I use Traefik as RP, and Mayan v4.5.8.

Thanks a lot for your help ^^

Cédric

Hello Cedric,

I got the same challenge and found a (partial) solution. While the settings are named ORGANIZATIONS_INSTALLATION_URL and ORGANIZATIONS_URL_BASE_PATH, the environment variables have to be prefixed with MAYAN_. Quote from https://docs.mayan-edms.com/apps/smart_settings:

To pass a value via an environment variable append “MAYAN_” to the name of the settings option.

This means the following has to be set, either in the .env file or in the docker-compose.yml file (for the x-mayan-container service):

MAYAN_FRONTEND_HTTP_PORT=49160
MAYAN_ORGANIZATIONS_URL_BASE_PATH=mayan/one
MAYAN_ORGANIZATIONS_INSTALLATION_URL=http://dev.local:${MAYAN_FRONTEND_HTTP_PORT}

After restarting the Docker container, the Mayan EDMS instance is still available via localhost by accessing the following URL: http://localhost:49160/mayan/one

I got one issue, though: Accessing this URL redirects to localhost:49160/mayan/one/authentication/login/?next=/mayan/one/home/ (which looks ok). But after successful login one gets redirected to localhost:49160/#/ and an empty white page (the HTML source only contains a <script> element with some stuff) is displayed. After manually accessing localhost:49160/mayan/one I’m able to use the instance.

Does anyone know how to fix this “white screen login” issue?

Sorry for the incomplete links, but I’m not allowed to post more than two URLs.