nginx简单WordPress 重写规则


nginx简单WordPress 重新规则网站配置文件,这个配置文件可以用于wordpress没有使用缓存条件下。

server {
listen 80;

server_name example.com www.example.com;

root /usr/local/www/example.com;

access_log /var/log/nginx/example.access.log;
error_log /var/log/nginx/example.error.log;

location / {
try_files $uri $uri/ /index.php;
}

location /search { limit_req zone=kbeezieone burst=3 nodelay; rewrite ^ /index.php; }

fastcgi_intercept_errors off;

location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}

include php.conf;

# You may want to remove the robots line from drop to use a virtual robots.txt
# or create a drop_wp.conf tailored to the needs of the wordpress configuration
include drop.conf;
}