Created
December 3, 2014 16:19
-
-
Save alterakey/2c657e8d635ef3b27924 to your computer and use it in GitHub Desktop.
nginx configuration for CakePHP 2.0.3
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
include fastcgi_params; | |
fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
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 cakephp.test; | |
root /var/www/cakephp/app/webroot; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
location / { | |
index index.php; | |
try_files $uri $uri/ @cakephp; | |
} | |
location @cakephp { | |
rewrite ^(.+)$ /index.php last; | |
} | |
location ~ \.php$ { | |
include fastcgi_params_cakephp; | |
fastcgi_pass php; | |
} | |
location ~ \.php/ { | |
include fastcgi_params_cakephp; | |
fastcgi_pass php; | |
} | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
location = /robots.txt { | |
log_not_found off; | |
access_log off; | |
} | |
location ~ /(\.ht|\.user.ini|\.git|\.hg|\.bzr|\.svn) { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment