Config FastCGI for nginx on Ubuntu

0
2532
FastCGI
FastCGI

For Ubuntu and nginx are so popular, users can get FastCGI configured and installed very easy.

First let’s install nginx:


$ sudo apt-get update
$ sudo apt-get install nginx

FastCGI is already bundled with nginx, so you don’t need to worry about it. Move to config the FastCGI module by updating the config file.


# file: /etc/nginx/sites-enabled/default
server {
    ...
    location / {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.html;
        include fastcgi_params;
    }
}

whereas,

  • fastcgi_pass : is the address and port that spawned fastcgi resolving host.
  • fastcgi_index : the default index file
  • include fastcgi_params : to include all necessary to pass through fastcgi (this file is located at /etc/nginx/fastcgi_params).

Alright, restart nginx to load the new config.