[英]Add a URL path prefix to artifactory installation (Docker)
I'm running Artifactory CPP CE 7.7.3 and Traefik v2.2 using docker-compose
.我正在使用docker docker-compose
运行Artifactory CPP CE 7.7.3和Traefik v2.2 。 The service is only available over http://localhost/ui/
.该服务仅在http://localhost/ui/
可用。 Now, what I need is an option which allows to add a URL path-prefix (eg http://localhost/artifactroy/ui
).现在,我需要的是一个允许添加 URL 路径前缀的选项(例如http://localhost/artifactroy/ui
)。
./templates/docker-compose.yaml
.我的docker.compose.yaml是官方提取自jfrog-artifactory-cpp-ce-7.7.3-compose.tar.gz : ./templates/docker-compose.yaml
。 [...] labels: - "traefik.http.routers.artifactory.rule=Host(`localhost`) && PathPrefix(`/ui`)" - "traefik.http.routers.artifactory.middlewares=artifactory-stripprefix" - "traefik.http.middlewares.artifactory-stripprefix.stripprefix.prefixes=/" - "traefik.http.services.artifactory.loadbalancer.server.port=8082"
With this I managed to access artifactory over http://localhost/ui/
.有了这个,我设法通过http://localhost/ui/
访问了 artifactory。
I have multiple small services running on my server, each of this service is accusable via http://localhost/<service-name>
.我的服务器上运行着多个小服务,每个服务都可以通过http://localhost/<service-name>
指责。 This is very convenient and want to make clear that this URL is related to this service on my production server.这个很方便,想说明这个网址和我生产服务器上的这个服务有关。 Because of this, I want to have an URL like http://localhost/artifactroy/ui/...
instead of http://localhost/ui/...
因此,我想要一个像http://localhost/artifactroy/ui/...
这样的 URL 而不是http://localhost/ui/...
I struggled getting artifactory setup in that way.我很难以这种方式获得人工设置。 I already managed to get a redirection from typing eg http://localhost/artifactroy/
to http://localhost/ui/
but this is not what I want on my production server.我已经设法从键入例如http://localhost/artifactroy/
重定向到http://localhost/ui/
但这不是我想要的我的生产服务器。
http://localhost/artifactroy/ui/...
(Only partially successful, redirection didn't work afterwards)尝试配置 traefik 整整两天,以更改标题以将 repose 指向http://localhost/artifactroy/ui/...
(仅部分成功,之后重定向不起作用)$JFROG_HOME/artifactory/var/etc
( Not successful)试图寻找它负责在配置artifactory的配置$JFROG_HOME/artifactory/var/etc
(没有成功)Is this even possible?这甚至可能吗? Help is highly appreciated..非常感谢帮助..
This example (even though not traefic example) gives you a direction to implement it.这个示例(即使不是 traefic 示例)为您提供了实现它的方向。 There are certain routes already used within the product.产品中已经使用了某些路线。 You need to add a context over and above it to ensure all comes via the new context path.您需要在其上方添加一个上下文,以确保所有内容都来自新的上下文路径。
https://jfrog.com/knowledge-base/how-to-remove-artifactory-from-the-context-url-in-artifactory-7/ https://jfrog.com/knowledge-base/how-to-remove-artifactory-from-the-context-url-in-artifactory-7/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.