plantuml / plantuml-server

PlantUML Online Server
https://plantuml.com/
GNU General Public License v3.0
1.65k stars 472 forks source link

Nginx can not serve it on subdirectory well since jetty-v1.2023.5 (Solved) (Need document) #277

Open zero00072 opened 1 year ago

zero00072 commented 1 year ago

Describe the bug

I have installed PlantUML container version jetty-v1.2023.1 and version jetty-v1.2023.5 behind Nginx reverse proxy. PlantUML ver jetty-v1.2023.5 can not inject my Host base url (with subdirectory) to HTML urls. So that the HTML page expect the base url reffer to a real root, and omit them. Then, all web resources and urls missed.

To Reproduce

Steps to reproduce the behavior:

  1. Setting Nginx reverse proxy.

    location /plantuml/ {
    rewrite /plantuml(.+) $1 break;
    
    proxy_set_header Host $http_host/plantuml;
    
    proxy_pass http://plantuml:8080;
    proxy_cache off;
    }
  2. docker-compose up -d plantuml

  3. Visit the web which Nginx served. With url: https://<domain_name>/plantuml/.

Expected behavior

Work well like PlantUML container version jetty-v1.2023.1.

Screenshots

jetty-v1.2023.1 jetty-v1.2023.5
jetty-v1.2023.1 jetty-v1.2023.5

Desktop:

zero00072 commented 1 year ago

There are no more information at dockerhub to describe the usage.

Just remove all:

location /plantuml/ {
  proxy_pass http://plantuml:8080;
  proxy_cache off;
}

And add variable:

---
version: '3'
services:
  plantuml:
    image: plantuml/plantuml-server:jetty
    restart: always
    environment:
      BASE_URL: plantuml
      PLANTUML_LIMIT_SIZE: 8192
...
HeinrichAD commented 1 year ago

I agree that the documentation on DockerHub is quite short. There could at least be a section which indicates that there is more information/documentation, as well as examples, on the GitHub repository. But this can only be done by somebody with access to the DockerHub account.

If I have understood the described situation correctly, then the example "Nginx reverse proxy example with defined location directive (different context path)", should cover exactly your case. Perhaps the example will also answer some still remaining questions.