# Load Balancer Path - Map to / on Container

**URL:** <https://forums.suse.com/t/load-balancer-path-map-to-on-container/5753>\
**Category:** Rancher 1.x\
**Created:** [March 6, 2017, 12:05am UTC](https://forums.suse.com/t/load-balancer-path-map-to-on-container/5753 "2017-03-06T00:05:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hilltopmediadesign](https://avatars.discourse-cdn.com/v4/letter/h/9fc348/32.png) [@hilltopmediadesign](https://forums.suse.com/u/hilltopmediadesign)\
**Post date:** [March 6, 2017, 12:05am UTC](https://forums.suse.com/t/load-balancer-path-map-to-on-container/5753/1 "2017-03-06T00:05:00Z")

</div>

What I’m looking to do:

Create a Load Balancer for a service that maps like this:

[example.com/app](http://example.com/app) to / on targeted service

The “/app” gets passed through to the service using these settings:

host: [example.com](http://example.com)  
path: /app  
target: targeted service  
port: exposed port

Thanks.

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [March 6, 2017, 9:20am UTC](https://forums.suse.com/t/load-balancer-path-map-to-on-container/5753/2 "2017-03-06T09:20:01Z")

</div>

You can do this with custom haproxy config, but it will [not really work](http://forums.suse.com/t/question-about-lb-with-a-request-path/997/2?u=vincent) for many applications.

---

<div class="post-metadata">

**Author:** ![hilltopmediadesign](https://avatars.discourse-cdn.com/v4/letter/h/9fc348/32.png) [@hilltopmediadesign](https://forums.suse.com/u/hilltopmediadesign)\
**Post date:** [March 6, 2017, 4:34pm UTC](https://forums.suse.com/t/load-balancer-path-map-to-on-container/5753/3 "2017-03-06T16:34:53Z")

</div>

Thanks Vincent. Do you know if Traefik would be a more effective solution to the problem, or is this just the nature of port mapping?

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [March 6, 2017, 5:08pm UTC](https://forums.suse.com/t/load-balancer-path-map-to-on-container/5753/4 "2017-03-06T17:08:41Z")

</div>

It has nothing to do with the software that’s rewriting the request…

The problem is you’re stripping off part of the path, and that information is needed for many applications to generate URLs that need to come back around and talk to itself.

---

<div class="post-metadata">

**Author:** ![hilltopmediadesign](https://avatars.discourse-cdn.com/v4/letter/h/9fc348/32.png) [@hilltopmediadesign](https://forums.suse.com/u/hilltopmediadesign)\
**Post date:** [March 6, 2017, 10:10pm UTC](https://forums.suse.com/t/load-balancer-path-map-to-on-container/5753/5 "2017-03-06T22:10:49Z")

</div>

Thank you. That’s helpful.
