Skip to content

Instantly share code, notes, and snippets.

@7rin0
Forked from pasela/cakephp2.conf
Created July 26, 2018 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7rin0/bb30662377bd0eb4aa1a4ca96235ed6f to your computer and use it in GitHub Desktop.
Save 7rin0/bb30662377bd0eb4aa1a4ca96235ed6f to your computer and use it in GitHub Desktop.
nginx configuration example for CakePHP 2.x
#
# 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