查询字符串返回Nginx服务器

时间:2015-11-30 13:36:20

标签: codeigniter nginx query-string

我最近从Apache服务器迁移到nginx服务器。代码是在CI中开发的。但$ _SERVER ['query_string']变量和$ _GET变量也显示控制器名称和方法名称。例如。假设我的网址是:

http://jawed.com/coding/php/?utm_source=DRGFTB&utm_campaign=CODPAGT

然后$ _SERVER ['query_string']将有$ _SERVER ['query_string'] => '/编码/ PHP /&安培; utm_source = DRGFTB&安培; utm_campaign = CODPAGT'。如果我打印$ _GET变量,它将显示

数组([/ coding / php /] => [utm_source] => DRGFTB [utm_campaign] => CODPAGT)

但是它不应该获取controller / methodName。即使在Apache服务器中,我也没有将controller / methodName作为查询字符串的一部分。

server {
listen 80;
server_name jawed.com;
root /var/www/html/jawed/;
index index.php index.html index.htm;
access_log /var/log/nginx/jawed-access.log;
error_log /var/log/nginx/jawed-error.log;

location ~* \.(htaccess|htpasswd|log|sh|inc|bak|epub) {
    deny all;
    }
location ~ /\.svn {
    deny all;
}
location / {
    if (!-e $request_filename)
    {
        rewrite ^/(.*)$ /index.php?/$1 last;
        break;
    }
}
location ~ \.css {
    add_header  Content-Type    text/css;
}
location ~ \.js {
    add_header  Content-Type    application/x-javascript;
}
location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    fastcgi_param SCRIPT_FILENAME /var/www/html/jawed$fastcgi_script_name;
    fastcgi_param PATH_INFO       $fastcgi_path_info;
}

}

任何帮助将不胜感激。

由于 下巴

0 个答案:

没有答案