nginx - docker中的plantuml,gitlab nginx配置不起作用
问题描述
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 vs https 可以在这里相关吗?
解决方案
我有完全相同的问题,这似乎有效:
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"
换句话说,我plantuml
从 URI 中删除,并将 URI 的其余部分简单地传递给后端。
推荐阅读
- scala - 在 IntelliJ 中调试 sbt 项目
- python-3.x - 在背景图像上绘制神经网络中权重的热图
- typescript - Typescript:如何实现具有条件返回类型的可调用类型?
- php - 用于显示相关帖子的 WordPress 简码
- c++ - 结构变量的动态分配
- django - 如何选择另一个表的特定字段作为表的外键?Sqlite3,Django==2.1
- c++ - 用螺纹产生旋转效果
- python-3.x - 尝试显示图像时出错:pyscreez.ImageNotFoundException
- django - 通过 django 管理界面添加模型实例后生成文件
- python - Python停止在特定条件下增加列表