装的是顶置的lnmp0.4

重启lnmp的时候,提示:- Reload LNMP...

  • Reload Nginx configure...
  • : "expires" directive is not allowed here in /usr/local/nginx/conf/wordpress_params_supercache.conf:3
  • configuration file /usr/local/nginx/conf/nginx.conf test failed
  • Nginx program is reloding!
  • Shutting down MySQL. SUCCESS!
  • Starting MySQL. SUCCESS!
  • Shutting down php_fpm . done
  • Starting php_fpm done复制代码nginx.conf中引用了wordpress_params_supercache.conf文件,如下所示:- server
  • {
  • listen 80;
  • server_name www.xxx.com xxx.com;
  • index index.html index.htm index.php;
  • root /home/wwwroot;
  • - include wordpress.conf;
  • include wordpress_params_supercache.conf;复制代码这是wordpress_params_supercache.conf文件的内容:- # if the requested file exists, return it immediately
  • if (-f $request_filename) {
  • expires 30d;
  • break;
  • }
  • - set $supercache_file '';
  • set $supercache_uri $request_uri;
  • - if ($request_method = POST) {
  • set $supercache_uri '';
  • }
  • - # Using pretty permalinks, so bypass the cache for any query string
  • if ($query_string) {
  • set $supercache_uri '';
  • }
  • - if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) {
  • set $supercache_uri '';
  • }
  • - # if we haven't bypassed the cache, specify our supercache file
  • if ($supercache_uri ~ ^(.+)$) {
  • set $supercache_file /home/wwwroot/wp-content/cache/supercache/$http_host/$1index.html;
  • }
  • - # only rewrite to the supercache file if it actually exists
  • if (-f $document_root$supercache_file) {
  • rewrite ^(.*)$ $supercache_file break;
  • }
  • - # all other requests go to Wordpress
  • if (!-e $request_filename) {
  • rewrite . /home/wwwroot/index.php last;
  • }复制代码