Skip to content

Instantly share code, notes, and snippets.

@Twipped
Created August 23, 2012 21:11
Show Gist options
  • Select an option

  • Save Twipped/3441804 to your computer and use it in GitHub Desktop.

Select an option

Save Twipped/3441804 to your computer and use it in GitHub Desktop.
# request for root gets passed directly to Primal
location = / {
rewrite ^ /index.php last;
}
# request for anything that doesn't exist, pass it to PHP
location / {
if (!-e $request_filename) {
rewrite ^ /index.php last;
}
}
# send all php requests to fastcgi
location ~ \.php$ {
try_files $uri $uri/ $uri/index.php /index.php;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment