简体   繁体   中英

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 . The service is only available over http://localhost/ui/ . Now, what I need is an option which allows to add a URL path-prefix (eg http://localhost/artifactroy/ui ).

My Setup

  • I used the described setup process from the Artifactory Docs suggest it.
  • Mydocker.compose.yaml is the official extracted from the jfrog-artifactory-cpp-ce-7.7.3-compose.tar.gz : ./templates/docker-compose.yaml .
  • I'm using a reverse proxy (traefik). For this, I've added the necessary traefik configuration lines to the docker-compose-file. Here is a small extract what I've added:
     [...] 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/ .


Problem:

I have multiple small services running on my server, each of this service is accusable via 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/...

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.

What I did

  • Went through the documentation in hope of finding an option which I just can passt to artifactroy to add a prefix ( Not successful).
  • Tried configure traefik two full days, to alter headers to get the repose point to http://localhost/artifactroy/ui/... (Only partially successful, redirection didn't work afterwards)
  • Tried finding the configuration which is responsible for configure artifactory in $JFROG_HOME/artifactory/var/etc ( Not successful)

Is this even possible? Help is highly appreciated..

This example (even though not traefic example) gives you a direction to implement it. 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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM