【2020-06-15】CodeIgniter在nginx下404 not found

2020年6月15日16:50:39 发表评论 41 热度

 

出现404一般为nginx的网站配置有问题,修改nginx的server如上面,就ok了

server {

        listen       80;
        server_name  test.platform;
        charset utf8;
        root  /data/www/platform/trunk;

        location / {
            index index.html index.php;
        }   
        
         location ~ \.php($|/) {
            
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info ^(.+\.php)(.*)$;
            fastcgi_param   PATH_INFO $fastcgi_path_info;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param    PATH_TRANSLATED    $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }   
        
        if (!-e $request_filename) {
            rewrite ^/(.*)$ /index.php/$1 last;
            break;
        }   


        access_log  /usr/local/nginx/logs/test.platform.access.log;
        error_log  /usr/local/nginx/logs/test.platform.error.log;
    }

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: