我尝试在我的vps上运行yii应用程序,该应用程序是以nginx作为服务器安装的。但是当我访问我的域名:www.domain.com时,页面显示正常,但如果始终访问一个链接,则找不到404错误。我的nginx设置有问题吗?
我的nginx配置:
server {
listen 80;
server_name www.mydomain.com;
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
答案 0 :(得分:0)
index
行下面的添加此行
try_files $uri $uri/ /index.php$request_uri;