Thinking through an idea, wanted to get feedback/suggestions:
Having had great success with url rewriting and nginx, I'm now thinking of a more capable reverse proxy/router that would do the following:
- Map requests to handlers based on regex matching (ala Django)
- Certain requests would simply be routed to backend servers - eg. static media, memcached, etc
- Other requests would render templates that pull in data from several backend servers
For example, a template could consist of:
<body>
<div>{% remote http://someserver/somepage %}</div>
<div>{% remote http://otherserver/otherpage %}</div>
</body>
The reverse proxy would make the http requests to someserver/somepage and otherserver/otherpage and pull the results into the template.
Questions:
- Does the idea make sense or is it a bad idea?
- Is there an existing package that implements something like this?
- How about an existing server+scripting for implementing this - eg. lighttpd+lua, nginx+??
- How about nginx+SSI? Looks pretty capable, if you have experience / recommendations please comment.
- How about something like a scripting language+eventlet ?
- Twisted?
My preferences are python for scripting and jinja/django style templates, but I'm open to alternatives.