在nginx服务器上找不到Yii应用程序404


Yii application 404 not found with nginx server

我试图在我的vps上运行yii应用程序,该vps是作为服务器与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;
   }
}

index行下方添加此行

try_files $uri $uri/ /index.php$request_uri;