Hi, Setting up servers with Couch as the web server, I have used firewall prerouting to redirect everything port 80 to couch Anyone with a better approach to this than this?
$ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 5984 I also tried an approach with Nginx forwarding everything to localhost:5984 with the new rewrite function. The problem here was that the IP adress of the request object got lost on its way, so the new rewrite function would report peer to be 127.0.0.1 while the first method leaves the request object raw and wil enable us to do all sorts of IP address range stuff in the rewrite. johs PS for those not familiar with the beuty of combining - couch on port 80 and - vhost to _rewrite og a design document... This combination allows design documents that act as API servers (very exiting with the new rewrite function) and be endpoints of various domains. On the same Couch instance, you can effectively do hosting service for many small sites. The convenience of managing this service through over REST opens up for some exiting concepts. Pointing to multiple design documents in the same database or multiple design documents in multiple databases. With ermouth's round robin technique inside the new rewrite function, we will also be able to create enough load balancing inside Couch to overcome some of its weekness at this point. Balancing load between several design documents as trick to multiply the request per second capacity for Couch 1.7 could be combined with using IP address range to prioritize "home market" towards the rest of the world, and send requests from regions in the world outside a site's market to a login page or "the contene is not available for you region" page. If you are e.g. a dentist or thousand devices in a local village, there is really no need to serve the entire internet with anything, especially if you are running on a tiny linux machine inside a small box some sort that cannot hold the entire stack of systems that the couchapp haters think we should install.