Skip to content

Instantly share code, notes, and snippets.

@ianshea
Forked from kenzie/craft.conf
Last active December 25, 2015 18:19
Show Gist options
  • Save ianshea/7020140 to your computer and use it in GitHub Desktop.
Save ianshea/7020140 to your computer and use it in GitHub Desktop.
server {
listen 80;
root /var/www/craft.dev/public;
index index.php index.html index.htm;
server_name craft.dev;
location / {
try_files $uri $uri/ @rewrites;
}
location @rewrites {
rewrite ^(.*) /index.php?p=$1 last;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
error_page 404 /index.php;
}
<?php
/**
* General Configuration
*
* All of your system's general configuration settings go in here.
* You can see a list of the default settings in craft/app/etc/config/defaults/general.php
*/
return array(
/**
* Whether generated URLs should be formatted using PATH_INFO, e.g. http://domain.com/index.php/path/,
* as opposed to using the query string, e.g. http://domain.com/index.php?p=path
*
* Possible values: true, false, 'auto'
*/
'usePathInfo' => false,
'omitScriptNameInUrls' => true
);
@ianshea
Copy link
Author

ianshea commented Oct 17, 2013

For setup on Digital Ocean Ubuntu 12.04 x64

https://www.digitalocean.com/community/articles/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04

You'll also need to install curl

Make sure to chown your public web folder to www-data:www-data so Craft can read above root.

@Harry-Harrison
Copy link

Wish I'd thought to check your fork before spending ages trying to fix it myself 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment