Closed CyberSeppi closed 1 year ago
If I have to guess, I think the problem is that an !include http://localhost
or !include http://plantuml-server
, at the time of fetching the diagram, points to itself (PlantUML Server) and not to the Nginx server.
The following situation is working for me:
I modified the Nginx reverse proxy example with defined location directive (different context path).
What I did:
nginx-contextpath/diagrams/test.puml
:
Alice -> Bob : "I am from another file"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
+ - ./diagrams:/www/diagrams:ro
tell Nginx (nginx.conf
) to server (static) the newly added directory
http {
+ # OPTIONAL (It work for me with and without it)
+ types {
+ text/plain puml;
+ }
server {
listen 80;
server_name localhost;
+ root /www;
# PlantUML
location /plantuml/ {
proxy_pass http://plantuml-server:8080/plantuml/;
}
}
# ...
docker compose up -d
(see example README)@startuml
!include http://nginx/diagrams/test.puml
Bob -> Alice : hello
@enduml
NOTE: I used !include http://nginx/diagrams/test.puml
and not localhost
! The reason is fairly simple, at the time when the PlantUML Server tries to fetch the diagram from localhost
, localhost
does not point to the Nginx server but to the PlantUML Server itself.
Hi there,
I set up an nginx which should serve static files (diagrams in my case) that can be included into others like
!include https://......
The thing is, that it doesn´t work. It works with, e.g https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
The difference are the META of the http response, and that favicon.ico, which I had to "dummy" (just return 200 without content)
Can you tell me how to set up the response to make it working ?
Thanks and Greetings,
Julian