【问题标题】:plantuml in docker, gitlab nginx configuration doesnt workdocker中的plantuml,gitlab nginx配置不起作用
【发布时间】:2020-05-28 00:43:50
【问题描述】:

plantuml 在 docker 上运行。
端口必须从 8080:8080 更改为 8088:8080。
它适用于http://localhost:8088/uml,不适用于http://localhost:8088/plantuml

gitlab推荐如下配置

nginx['custom_gitlab_server_config'] = "location /-/plantuml { \n rewrite ^/-/(plantuml.*) /$1 break;\n proxy_cache off; \n proxy_pass http://localhost:8088/plantuml; \n}\n"

由于上述情况,我尝试了以下方法但没有成功(uml 而不是 plantuml)

nginx['custom_gitlab_server_config'] = "location /-/plantuml { \n rewrite ^/-/(plantuml.*) /$1 break;\n proxy_cache off; \n proxy_pass http://localhost:8088/uml; \n}\n"

您有什么建议可以解决这个问题吗?

编辑添加: 按照建议我试过了

nginx['custom_gitlab_server_config'] = "location /-/plantuml { \n rewrite ^/-/plantuml(.*) /uml$1 break;\n proxy_cache off; \n proxy_pass http://localhost:8088/uml; \n}\n"

调用https://gitlabdomain.com/uml/AxfDWj2tBq3CoKoPWR1Io8ZDoSa70000 的结果是 404

http 与 https 在这里是否相关?

【问题讨论】:

  • 试试这个nginx['custom_gitlab_server_config'] = "location /-/plantuml { \n rewrite ^/-/plantuml(.*) /uml$1 break;\n proxy_cache off; \n proxy_pass http://localhost:8088/uml; \n}\n"

标签: nginx gitlab plantuml


【解决方案1】:

我遇到了完全相同的问题,这似乎有效:

nginx['custom_gitlab_server_config'] = "location /-/plantuml { \n rewrite ^/-/plantuml(.*) $1 break;\n proxy_cache off; \n proxy_pass http://localhost:YOUR_PORT/uml; \n}\n"

换句话说,我从 URI 中删除了 plantuml,并将 URI 的其余部分简单地传递给后端。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-14
    • 1970-01-01
    • 2018-12-29
    • 2019-07-15
    • 1970-01-01
    • 2016-01-12
    • 1970-01-01
    • 2021-11-24
    相关资源
    最近更新 更多