Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lunacite opened this issue Nov 19, 2020 · 4 comments

Comments

@lunacite
Copy link

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
@zyzzyxdonta
Copy link

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

@delameter
Copy link

delameter commented Mar 24, 2023

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

@zyzzyxdonta
Copy link

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.

@JoghurtMitDerEcke
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants