Last active
December 13, 2015 22:19
-
-
Save wokamoto/4983999 to your computer and use it in GitHub Desktop.
[Nginx] Nginx で Cake PHP を動作させる
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
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
さらに以下のシンボリックリンクを作っておくこと
$ ln -s app/webroot/css css
$ ln -s app/webroot/img img
$ ln -s app/webroot/js js
$ ln -s app/webroot/files files