1

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;
   }

}

1 Answer 1

1

below the index line add this line

try_files $uri $uri/ /index.php$request_uri;
1
  • After I changed as you said it was not the 404 error anymore but 500 (Internal Server Error) Aug 12, 2013 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.