Skip to content

Instantly share code, notes, and snippets.

@maxp
Created April 13, 2010 05:29
Show Gist options
  • Select an option

  • Save maxp/364342 to your computer and use it in GitHub Desktop.

Select an option

Save maxp/364342 to your computer and use it in GitHub Desktop.
A basic FastCGI configuration for nginx looks like this:
location /yourapplication/ {
include fastcgi_params;
if ($uri ~ ^/yourapplication/(.*)?) {
set $path_url $1;
}
fastcgi_param PATH_INFO $path_url;
fastcgi_param SCRIPT_NAME /yourapplication;
fastcgi_pass unix:/tmp/yourapplication-fcgi.sock;
}
This configuration binds the application to /yourapplication.
If you want to have it in the URL root it’s a bit easier because
you don’t have to figure out how to calculate PATH_INFO and SCRIPT_NAME:
location /yourapplication/ {
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_NAME "";
fastcgi_pass unix:/tmp/yourapplication-fcgi.sock;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment