-
-
Save 7rin0/bb30662377bd0eb4aa1a4ca96235ed6f to your computer and use it in GitHub Desktop.
nginx configuration example for CakePHP 2.x
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
# | |
# nginx configuration example for CakePHP 2.x | |
# | |
server { | |
listen 80; | |
server_name cakephp2.example; | |
root /var/www/cakephp2/app/webroot; | |
access_log /var/log/nginx/cakephp2.access.log; | |
error_log /var/log/nginx/cakephp2.error.log; | |
location / { | |
index index.php; | |
try_files $uri $uri/ /index.php$is_args$args; | |
} | |
location ~ \.php$ { | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_pass 127.0.0.1:9000; | |
} | |
location ~ \.php/ { | |
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; | |
fastcgi_pass 127.0.0.1:9000; | |
} | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
location = /robots.txt { | |
log_not_found off; | |
access_log off; | |
} | |
#error_page 404 /404.html; | |
#location = /404.html { | |
# root /usr/share/nginx/html; | |
#} | |
# redirect server error pages to the static page /50x.html | |
# | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /usr/share/nginx/html; | |
} | |
# deny access to .htaccess files, if Apache's document root | |
# concurs with nginx's one | |
# | |
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