Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php URL参数的codeigniter的Nginx重写规则_Php_.htaccess_Codeigniter_Mod Rewrite_Nginx - Fatal编程技术网

Php URL参数的codeigniter的Nginx重写规则

Php URL参数的codeigniter的Nginx重写规则,php,.htaccess,codeigniter,mod-rewrite,nginx,Php,.htaccess,Codeigniter,Mod Rewrite,Nginx,我为代码点火器的nginx服务器做了以下配置,并且工作正常,不幸的是有一个案例不工作 当我请求带有如下参数的URL时 servername.com/ControllerName/methodName?param=value 我找不到404页 服务器配置: server { # access from localhost only listen 127.0.0.1:80; server_name serverName.com; root

我为代码点火器的nginx服务器做了以下配置,并且工作正常,不幸的是有一个案例不工作

当我请求带有如下参数的URL时

servername.com/ControllerName/methodName?param=value 我找不到404页

服务器配置:

server {
    # access from localhost only
    listen       127.0.0.1:80;
    server_name  serverName.com;
    root         API;


    log_not_found off;
    charset utf-8;

    access_log  logs/accessservername.log main;
index index.php;
    # handle files in the root path /www
     location / {
         try_files $uri $uri/ /index.php?$args;
     }    

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   API;
    }


    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9100
    #
    location ~ \.php$ {
        try_files      $uri =404;
        fastcgi_pass   php;
        fastcgi_index  index.php;  
        #fastcgi_param  PHP_FCGI_MAX_REQUESTS 1000;
        #fastcgi_param  PHP_FCGI_CHILDREN 100;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param   REMOTE_ADDR $http_x_real_ip;
        include        fastcgi_params;

    }

    # add expire headers and speed up image access with a vary header
    location ~* ^.+.(gif|ico|jpg|jpeg|png|flv|swf|pdf|mp3|mp4|xml|txt|js|css)$ {
        expires 30d;
        add_header Vary Accept-Encoding;
    }

    # only allow these request methods
    if ($request_method !~ ^(GET|HEAD|POST)$ ){ return 405; }

}

你找到解决办法了吗?目前正在使用非常旧的CI 1.6.3应用程序体验这种情况。请查看以下内容: