修改vhost下的配置文件(并不是nginx.conf)
vi /usr/local/nginx/conf/vhost/yoursite.conf
在root /home/wwwroot/yoursite下一行添加
location / {
try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
网站上了ssl,所以在80 和443 的server下面都有添加。
然后保存退出,重启nginx
service nginx restart
或者/etc/init.d/nginx restart