I need to add prefix to the URL and have it serve content from another URL . Basically the HAProxy is running on another server and I have artifactory server on another . The artifactory listens on 8081 , so I hit artifactoryserverIp:8081 and artifactory homepage displays . Now if I hit HAProxyServer/abcartifactory in browser , the URL should stay the same , but it should internally hit artifactoryserverIp:8081.
Here is my configuration
frontend http
bind *:80
acl host_is_artifactory path_beg /abcartifactory
use_backend artifactory-backend if host_is_artifactory
backend artifactory-backend
reqrep ^([^\ :]*)\ /(.*) \1\ /abcartifactory/\2
server node1 artifactoryserver:8081
The output is that the browser says cannot find resource
Try this
frontend http
bind *:80
acl host_is_artifactory path_beg /abcartifactory
use_backend artifactory-backend if host_is_artifactory
backend artifactory-backend
reqrep ^([^\ ]*\ /)abcartifactory [/]?(.*) \1\2
server node1 artifactoryserver:8081