views:

164

answers:

2

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.

A: 

So instead of doing something an AJAXy call into an iframe or something, you're doing it on the server side.

I think it's something I'd only do if the external site was totally under my control, purely for the security implications. It'd also hit your response times quite a bit.

Am I missing the point completely, or would this be quite simple to do with some functions & urllib?

dochead
Right, assemble it on the server side instead of using iframes/ajax. It is quite simple to build (I have a prototype working nicely), but I'm looking for a production level, high performance implementation. Regarding response times: not necessarily. Reverse proxies sometimes even improve performance by handling slow client connections and letting the backend do real work.
Parand
+1  A: 

This already exist an is called Deliverance: http://deliverance.openplans.org/

gawel