Created
February 2, 2011 14:32
-
-
Save slywalker/807748 to your computer and use it in GitHub Desktop.
nginx cakephp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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