<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi All,<div><br></div><div>I am wondering if there is a way for nginx to use some kind of external variables or to include a perl/shell script to use it's configuration? Let me show you what I mean with an example:</div><div><br></div><div>We are providing rails hosting services, and currently use lighty as default httpd, with 2 fastcgi ruby processes behind it. We've tuned the lighttpd scripts so that a user only needs a config file like this:</div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><br><span class="Apple-style-span" style="font-family: Courier; ">### Rails Application Configuration File</span><br><br><span class="Apple-style-span" style="font-family: Courier; ">$HTTP["host"] =~ "^(dev\.)?rubyist\.be" {</span><br><span class="Apple-style-span" style="font-family: Courier; ">&nbsp;&nbsp;var.app = "www"</span><br><br><span class="Apple-style-span" style="font-family: Courier; ">&nbsp;&nbsp;accesslog.filename &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= base + "/logs/" + app + ".access.log"</span><br><span class="Apple-style-span" style="font-family: Courier; ">&nbsp;&nbsp;server.errorlog &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = base + "/logs/" + app + ".error.log"</span><br><br><span class="Apple-style-span" style="font-family: Courier; ">&nbsp;&nbsp;load Rails with capistrano app</span><br><span class="Apple-style-span" style="font-family: Courier; ">}</span><br><br></blockquote><div>The lighty script then launches the lighttpd server as that user, with a port based on his uid, and does the dispatching-to-rails-fcgi magic.</div><div><br></div><div>I want to change to lighty, but need to have something similar, that does all the magic for the user, without the need to write their own config files.</div><div><br></div><div>Is there such a way in nginx?</div><div><br></div><div>Regards,</div><div><br></div><div>Frank</div></body></html>