简体   繁体   中英

Yii application 404 not found with nginx server

I tried to run the yii application on my vps which is installed with nginx as a server. but when I access my domain: www.domain.com, pages appear fine but if one link is always accessed 404 not found error. Is there something wrong with my nginx settings?

My nginx configuration :

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM