Skip to content

Instantly share code, notes, and snippets.

@pandanote-info
Created January 4, 2020 14:43
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 pandanote-info/880db164b584cdb37629a4053ea88376 to your computer and use it in GitHub Desktop.
Save pandanote-info/880db164b584cdb37629a4053ea88376 to your computer and use it in GitHub Desktop.
Wordpressで用意した404.phpを表示させるためのnginx.confの設定
http {
(略)
server {
(略)
error_page 404 = @notfound;
location @notfound {
root (Apache httpdでDocumentRootとして設定していた値);
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SERVER_NAME $host;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param QUERY_STRING error=404;
fastcgi_pass php-fpm;
}
(略)
}
(略)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment