在用nginx搭建wordpress平台时,遇到500 Internal Server Error nginx这个错误,具体在配置wp-super-cache时出现的,检查了下虚拟主机配置,需要将在location /{}段定义的index和root挪出来,如下:

修改前:

server {
    listen   80;
    server_name  bdwm.info;
    charset utf-8;
    error_page  404  =  //index.php?q=$uri;

    location / {
    index index.html index.htm index.php;
    root /home/sites/bdwm.info;
    ……
    }
    ……
}

修改后:

server {
    listen   80;
    server_name  bdwm.info;
    charset utf-8;
    error_page  404  =  //index.php?q=$uri;
    index index.html index.htm index.php;
    root /home/sites/bdwm.info;
    location / {
    ……
    }
    ……
}