Created
August 1, 2011 20:42
-
-
Save zeroasterisk/1118945 to your computer and use it in GitHub Desktop.
app - /etc/nginx/standard_location_config_cakephp
This file contains 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
# | |
# These are standard location configs which should be setup in all CakePHP apps | |
# basic php functionality | |
# basic document resolution configuration | |
# basic security | |
# basic optimization | |
# | |
#PHP Magic | |
location ~ \.php(.*)$ { | |
fastcgi_pass unix:/var/run/php5-fpm.socket; | |
} | |
location ~ \..*/.*\.php(.*)$ { | |
return 403; | |
} | |
#Site Locations | |
location / { | |
rewrite ^/$ /index.php?url=/ last; | |
if (-f $request_filename) { | |
break; | |
} | |
try_files $uri $uri/ /index.php?url=$request_uri; | |
if (!-f $request_filename) { | |
rewrite ^/(.*)$ /index.php?url=$1 last; | |
} | |
} | |
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html|swf|flv|mp3|m4v)$ { | |
access_log off; | |
expires 30d; | |
try_files $uri $uri/ /index.php?url=$request_uri; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
location = /robots.txt { | |
allow all; | |
log_not_found off; | |
access_log off; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment