用户
 找回密码
 入住 CI 中国社区
搜索
12
返回列表 发新帖
楼主: phillu
收起左侧

[版本 3.x] $this->input->get()的获取数据不全 求教大神们!!!

[复制链接]
 楼主| 发表于 2017-3-30 11:07:40 | 显示全部楼层
Hex 发表于 2017-3-30 10:44
感觉可能是配置有问题,你用这个 nginx 配置试试,CI 中国用的就是类似这样,应该可以正确获取 QUERY_STRI ...

额   Access denied. 了
 楼主| 发表于 2017-3-30 11:12:05 | 显示全部楼层
本帖最后由 phillu 于 2017-3-30 11:13 编辑
Hex 发表于 2017-3-30 10:44
感觉可能是配置有问题,你用这个 nginx 配置试试,CI 中国用的就是类似这样,应该可以正确获取 QUERY_STRI ...

我Nginx配置

server {

    listen 80;
    listen 443 ssl;
    server_name ~^(?<domain>\w+).driver-backend.xxxx.org$ ;
    index index.html index.php

    ssl                  on;
    ssl_certificate      /etc/pki/tls/certs/alphassl.xxxx.org.ngx.crt;
    ssl_certificate_key  /etc/pki/tls/private/alphassl.xxxx.org.nopass.key;
    ssl_session_timeout  5m;
    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers   on;


    root /home/$domain/git/driver-backend/;

    gzip              on;
    gzip_min_length   1000;
    #gzip_proxied     expired no-cache no-store private auth;
    gzip_proxied      any;
    gzip_types        text/plain application/x-javascript text/css application/xml;
    gzip_disable      "MSIE [1-6]\.";
    gzip_http_version 1.0;

    error_log  /var/log/nginx/driver-backend_error_log;
    access_log /var/log/nginx/${domain}_driver-backend_access_log main;

    error_page 404 /error/404.php;
    rewrite ^/error/404.php /error/404.php break;

    if ( $scheme = https ) {
        rewrite !^/(payment|login|register|ajax|images|order|brand\/payment|brand\/ajax|i|corp|touch)/ http://www.xxxx.com/$1/ redirect;
    }



    location / {
        root /home/$domain/git/driver-backend/;

        try_files      $uri $uri/ /index.php$uri?$args;
        fastcgi_pass   unix:/var/run/php-fpm/www.sock;
        fastcgi_index  index.php;
        include        fastcgi_params;
        set $path_info "";
        set $real_script_name $fastcgi_script_name;
        if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
            set $real_script_name $1;
            set $path_info $2;
        }

        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  PATH_INFO        $path_info;
        fastcgi_param SCRIPT_NAME $real_script_name;
        fastcgi_param  SERVER_NAME      driver-backend.xxxx.com;
        fastcgi_param  UNIQUE_ID        $uniqueid;
        fastcgi_param  PHP_ROOT         /home/$domain/git/driver-backend/;
    }

    location ~* \.(js|css|ico|gif|jpg|jpeg|png|swf|htc|xml|mp3|otf|svg|ttf|woff|xap|txt|eot|bin)$ {
        root /home/$domain/git/driver-backend/;
    }

    location ~ ^/(app|bd|demo|job|intro|car|service|help|xw|car|service) {
        root /home/y/var/www/cms/cms/page/;

        try_files $uri $uri/index.html $uri/index.php =404;
        fastcgi_pass   unix:/var/run/php-fpm/www.sock;
        fastcgi_index  index.php;
        include        fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  UNIQUE_ID        $uniqueid;
        fastcgi_param  PHP_ROOT         /home/$domain/git/driver-backend/;
    }

    location /cms {
        root /home/y/var/www/cms/;

        try_files $uri $uri/index.html $uri/index.php =404;
        fastcgi_pass   unix:/var/run/php-fpm/www.sock;
        fastcgi_index  index.php;
        include        fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  UNIQUE_ID        $uniqueid;
        fastcgi_param  PHP_ROOT         /home/$domain/git/driver-backend/;
    }
}

发表于 2017-3-30 17:21:21 | 显示全部楼层
phillu 发表于 2017-3-30 11:07
额   Access denied. 了

你可以根据你的情况改改,CI2 的用户手册确实是可以获取 GET 传参的,当时也是配置了一下 nginx 才可以的。
 楼主| 发表于 2017-3-30 17:44:14 | 显示全部楼层
Hex 发表于 2017-3-30 17:21
你可以根据你的情况改改,CI2 的用户手册确实是可以获取 GET 传参的,当时也是配置了一下 nginx 才可以的 ...

好的    谢谢   已经搞定了   $uri=parse_url('http://dummy'.html_entity_decode($_SERVER['REQUEST_URI']));  这样处理下就好了

本版积分规则