Skip to content

Instantly share code, notes, and snippets.

@shouhei
Created May 19, 2014 16:29
Show Gist options
  • Save shouhei/2b8bf4956bf19d94ab47 to your computer and use it in GitHub Desktop.
Save shouhei/2b8bf4956bf19d94ab47 to your computer and use it in GitHub Desktop.
wordpressをnginx+php-fpmで動かすためのやーつ
listen 80;
server_name ;#ドメイン名
root /path/to/wordpress; #ワードプレスのパス
index index.php;
error_log /path/to/log/error.log;#エラーログへのパス
access_log /path/to/log/sccess.log;#アクセスログへのパス
try_files $uri $uri/ /index.php?q=$uri&$args;
location / {
root /var/www/dev.b-engineer.co.jp/wp;
index index.php;
if (!-e $request_filename) {
rewrite ^.+?($/-.*) $1 last;
rewrite ^.+?(/.*\.php)$ $1 last;
rewrite ^ /index.php last;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /path/to/wordpress$fastcgi_script_name;#ワードプレスへのパス
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment