今天配置新网站报错nginx File not found.
server {
listen 80;
server_name china.cn
www.china .cn;
location / {
root /home/www/ayd;
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ .php$ {
root /home/www/ayd;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
以上配置是没问题的
后来发现是www文件夹权限不够
chmod 755 www/
就行了