- 前提条件:php-fpmが127.0.0.1:9000で動いているとする
nginxは標準でfastcgi.confという設定ファイルを用意してくれているので,
以下の設定のみでwordpressを設置できる.
server {
server_name example.jp;
root /path/to/wordpress;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
}
try_filesの行は,記事のURLをwordpress/2013/12/article-name/ のようにrewriteするために必要.