Installing Nginx on Ubuntu

Nginx web server installation (with root):

apt-get install nginx

Nginx configuration

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.

 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;

ASP.NET and ASP.NET MVC web applications runs on Nginx through FastCGI protocol, therefore you need to add few lines into/etc/nginx/fastcgi_params.

 fastcgi_param  PATH_INFO          "";
 fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
 fastcgi_param HTTP_HOST $host;

Now the Nginx part is complete, but to finish the whole thing Mono FastCGI server needs to be started.

 fastcgi-mono-server4 / /socket=tcp:

Now when Mono FastCGI server is up and running, Nginx configuration is complete and your application is in place (located in /var/www/ you can run the web server.

 /etc/init.d/nginx start

4 则回应给 Nginx运行fastcgi-mono-server4配置过程

  1. 弄个中文版的给英语菜鸟看下