Forum

1 hiawatha on 1 hostname with 2 fastcgi servers

Raphaël HUCK
9 June 2008, 18:54
Hi,

I'd like to have hiawatha forward to 2 different fastcgi servers depending on the URI:

- /first/* -> forward to fastcgi server of id FirstFcgi on port 81
- /second/* -> forward to fastcgi server of id SecondFcgi on port 82

on the same hostname.

I've read the doc several times and I don't really see how this could be done.

Is it possible? And how?

Thanks in advance.
Hugo Leisink
9 June 2008, 20:54
Hiawatha uses a FastCGI server based on the extension of the request URL. The trick is to use URL rewriting for the specified directories:

FastCGIserver {
FastCGIid = FCGI1
Extension = fcgi1
ConnectTo = 127.0.0.1:81
}

FastCGIserver {
FastCGIid = FCGI2
Extension = fcgi2
ConnectTo = 127.0.0.1:82
}

UrlRewrite {
RewriteId = my_rewrite
Match ^/first/.* Rewrite /first/index.cgi1
Match ^/seconds/.* Rewrite /seconds/index.cgi2
}

VirtualHost [
Hostname = www.website.com
WebsiteRoot = /path/to/webroot
FastCGI = FCGI1, FCGI2
RewriteURL = my_rewrite
}


I know it looks like a hack. My idea for the next release is to make this more 'clean'.
This topic has been closed.