drnf593779 2013-08-10 19:03
浏览 150

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

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条回答 默认 最新

  • dou72260 2013-08-10 20:16
    关注

    below the index line add this line

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

报告相同问题?

悬赏问题

  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法