Skip to content

DRAWIO_BASE_URL parameter not working with bind-mounted PreConfig.js & reverse proxy #46

Description

@lunacite

Base URL customization per this issue is not working, the following files still attempt to load from the root instead of the noted subdirectory (/diagram):
croppie.min.css
grapheditor.css
PreConfig.js
apple-touch-icon.png
favicon-16x16.png

Nginx location block

location /diagram { # begin diagram block
        auth_request /auth-4;
        proxy_pass  https://diagram-url:8443/;
        add_header X-Frame-Options "SAMEORIGIN";
        proxy_set_header Host $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;
} 

Docker-compose.yml

version: '3.5'
services:
  drawio:
    image: fjudith/draw.io
    container_name: drawio
    restart: unless-stopped
    ports:
      - 8080:8080
      - 8443:8443
    environment:
      PUBLIC_DNS: example.org
    volumes:
      - ./config/PreConfig.js:/usr/local/tomcat/webapps/draw/js/PreConfig.js

PreConfig.js

/**
 * Copyright (c) 2006-2019, JGraph Ltd
 * Copyright (c) 2006-2019, draw.io AG
 */
// Overrides of global vars need to be pre-loaded
window.EXPORT_URL = '/export'; //This points to ExportProxyServlet which uses the local export server at port 8000.
//This proxy configuration allows https requests to the export server via Tomcat.
window.PLANT_URL = 'REPLACE_WITH_YOUR_PLANTUML_SERVER';
// window.DRAWIO_BASE_URL = 'https://mcp.lunacite.com/diagram';
// window.DRAWIO_VIEWER_URL = 'https://mcp.lunacite.com/diagram/js/viewer.min.js';
window.DRAW_MATH_URL = 'math';
window.DRAWIO_CONFIG = null; //Replace with your custom draw.io configurations. For more details, https://desk.draw.io/support/solutions/articles/16000058316

Activity

  1. zyzzyxdonta commented on Jan 27, 2022

    @zyzzyxdonta

    Did you get it to work? I'm facing the same problem at the moment.

  2. delameter commented on Mar 24, 2023

    @delameter

    My "solution" was to use a separate subdomain for this, and also to give up attempts to make export-server and plantuml-server work.

  3. zyzzyxdonta commented on Mar 25, 2023

    @zyzzyxdonta

    Alright, I just went with a different port 😅 We're mainly using DrawIO from within a MediaWiki so it doesn't really matter that the URL looks a bit off.

  4. JoghurtMitDerEcke commented on May 12, 2023

    @JoghurtMitDerEcke

    I have found a solution that works for me. Maybe it will help someone else too.

    See #3175 or my comment jgraph/drawio#3175 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions