Skip to content

Instantly share code, notes, and snippets.

@slywalker
Created February 2, 2011 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save slywalker/807748 to your computer and use it in GitHub Desktop.
Save slywalker/807748 to your computer and use it in GitHub Desktop.
nginx cakephp
server {
listen 80;
server_name example.com;
root /var/www/cakephp/app/webroot;
index index.php index.html index.htm;
access_log /var/www/cakephp/app/tmp/logs/access.log;
error_log /var/www/cakephp/app/tmp/logs/error.log;
rewrite_log on;
location / {
# If the file exists as a static file serve it
# directly without running all
# the other rewite tests on it
if (-f $request_filename) {
break;
}
if (!-f $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
}
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
location ~ ^/img/ {
expires 7d;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment