Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know this might be related but I have a script that loads fastcgi-mono-server for defined websites on a configuration file and I need to a new website to the pool without having to reload all fastcgi process.


nginx -s reload

Just reload each server (website) configuration and I need a smoother process to add a new website to the current worker process.

share|improve this question
up vote 2 down vote accepted

The 'only' way would be to:

  • isolate all fast-cgi processes
  • forward connections to them with NGINX.

NGINX can forward connections toward a pool of fastCGI mono server. You can execute different fastcgi process for each of the website/application and modify you NGINX configuration to point to each of the application depending on the vhost or URL. Adding new sites will only requires a NGINX reload - which will NOT reload the whole mono server, only the NGINX internal forwarding rules.

Additional configuration examples can be found there:

For reference sake, I'm posting the main part: Nginx configuration (as of version 0.7.63) is located in /etc/nginx/nginx.conf (which contains http configuration) and in /etc/nginx/sites-available/default (where is configuration of particular virtual host or hosts). In order to setup ASP.NET or ASP.NET MVC web application, you need to modify virtual host configuration.

NGINX vhost configuration bloc. This forward to a fastcgi process running on port 9000 of the same system. You could be using 9001 for the second apps, etc. You could also be using dedicated servers to run your application, in such case, NGINX becomes a pseudo HTTP load balancer.

server {
     listen   80;
     access_log   /var/log/nginx/;

     location / {
             root /var/www/;
             index index.html index.htm default.aspx Default.aspx;
             fastcgi_index Default.aspx;
             include /etc/nginx/fastcgi_params;

and you control individual mono 'application' with:

fastcgi-mono-server2 / /socket=tcp:

Note: Answer edited a few times to provide additional and a more precise solution.

share|improve this answer
Doesn't this solution create some overhead on a single server? Can you supply a detailed how-to? – Rui Marques Jan 3 '12 at 14:07
Actually, using 2 instances of NGINX would create some overhead. However, re-reading the questions and my answer, I don't see why it would be required to add a second layer of NGINX. The NGINX already act as a load balancer, you simply need to forward to different pool of fastcgi-mono-server ... (run one for each website). They won't be able to use any shared memory, but this isn't as bad as having to kill all site. – CloudWeavers Jan 3 '12 at 14:15
The idea is to mimic the same isolation we have on IIS using application pools. I don't wan't to kill all sites, just to be able to have control over each on individually. To you have some configuration examples? – Rui Marques Jan 3 '12 at 14:24
I really want to give you this +50. – Rui Marques Jan 5 '12 at 21:57
Gave another shot with more precise solution and included a reference and examples. Sorry for the delay ;-) – CloudWeavers Jan 9 '12 at 13:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.