location /wordpress/ {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /wordpress/index.php;
}
}
rewrite /wordpress/wp-admin$ $scheme://$host$uri/ permanent;
主要目的用于固定静态连接,要注意location的指定目录,要与根目录保持一致,代码中指定目录下还有一个worpress文件夹,所以添加上了/wordpress/