# Best approach for Dynamic routing

**URL:** <https://www.ruby-forum.com/t/best-approach-for-dynamic-routing/220743>\
**Category:** NGINX\
**Created:** [June 19, 2012, 7:02am UTC](https://www.ruby-forum.com/t/best-approach-for-dynamic-routing/220743 "2012-06-19T07:02:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [June 19, 2012, 7:02am UTC](https://www.ruby-forum.com/t/best-approach-for-dynamic-routing/220743/1 "2012-06-19T07:02:35Z")

</div>

Hi All,

What is the best approach for implementing Dynamic routing for the below  
use case

-Route web service calls to a separate server (location based)  
-Route user UI Web requests to a separate server (location based)  
-A single server URL for multiple implementations and provide a  
mechanism to route to different web service server and UI server based  
on customers  
e.g.------------------- Nginx Proxy

c 1 [proxy.abc.com](http://proxy.abc.com) —\> | → Web service server S 1  
------------------------------- | → UI server S 1

c 2 [proxy.abc.com](http://proxy.abc.com) —\> | → Web service server S 2  
------------------------------- | → UI Server S 2

c n [proxy.abc.com](http://proxy.abc.com) —\> | → Web service server S n  
------------------------------- | → UI Server S n

- Ability to add web service server and UI server dynamically
- Ease to maintain and possibly have a central repository for the  
mapping and Web service server and UI server backend URLs
- Minimum proxy overhead

-paphillon

Posted at Nginx Forum:

> **[Best approach for Dynamic routing](https://forum.nginx.org/read.php?2,227678,227678#msg-227678)**
>
> Hi All, What is the best approach for implementing Dynamic routing for the below use case -Route web service calls to a separate server (location based) -Route user UI Web requests to a separate server (location based) -A single server URL for...

---

<div class="post-metadata">

**Author:** ![paphillon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/67e7ee/32.png) [@paphillon](https://www.ruby-forum.com/u/paphillon)\
**Post date:** [June 19, 2012, 4:19pm UTC](https://www.ruby-forum.com/t/best-approach-for-dynamic-routing/220743/2 "2012-06-19T16:19:33Z")

</div>

I’ve been tinkering with some Lua that uses redis that does something  
similar. In my “day job” we have a json file per site for a service  
and chef generates nginx configs from that. No UI or anything, but it  
gets it done.
