Nginx $ _GET参数为空

时间:2017-09-05 09:15:17

标签: php nginx

首先很抱歉,如果这是一个双重帖子,我已经搜索过,看到这个主题上有很多关于stackoverflow的帖子,但他们都说同样的事情,将$ args或$ query_strings添加到index.php它应该工作,但我已经做到了,它没有,它显示$ _GET参数为空。

以下是域

的配置文件
server {    
    listen      *:80;
    listen      *:443 ssl http2;
    server_name site.ro www.site.ro;
    # The Document Root
    root        /home/razvypp/www/site.ro;

    error_log   /usr/local/apps/nginx/var/log/site.ro.err;
    access_log  /usr/local/apps/nginx/var/log/site.ro.log main;

    location / {
            try_files $uri $uri/ /index.php?$args;
}


    ssl_certificate             /etc/ssl/cert/site.ro.crt;
    ssl_certificate_key         /etc/ssl/private/site.ro.key;
    ssl_dhparam                 /etc/ssl/private/dhparam.pem;



    location = /favicon.ico {
            log_not_found off;
            access_log off;
    }

    location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
    }



    include     /usr/local/apps/nginx/etc/conf.d/common;
}

1 个答案:

答案 0 :(得分:0)

您是否尝试过更改参数。

location / {
        try_files $uri $uri/ /index.html /index.php?$args;
}

将/index.html添加到现有代码后,它应该有效。