Skip to content

Instantly share code, notes, and snippets.

@wokamoto

wokamoto/cake_php.conf

Last active Dec 13, 2015
Embed
What would you like to do?
[Nginx] Nginx で Cake PHP を動作させる
server {
listen 80 default;
server_name example.com;
root /path/to/cake_php;
index index.php index.html index.htm;
charset utf-8;
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
location ~* \.(js|css|html?|xml|gz|jpe?g|gif|png|swf|wmv|flv|ico)$ {
expires 7d;
}
location / {
try_files $uri $uri/ /index.php?url=$uri$args;
}
location ~ \.php$ {
try_files $uri =404;
expires off;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass phpfpm;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
@wokamoto

This comment has been minimized.

Copy link
Owner Author

@wokamoto wokamoto commented Feb 19, 2013

さらに以下のシンボリックリンクを作っておくこと

$ ln -s app/webroot/css css
$ ln -s app/webroot/img img
$ ln -s app/webroot/js js
$ ln -s app/webroot/files files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment