Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

i have nginx configured like this:

server {
    listen   80; 
    listen   [::]:80 default ipv6only=on;
    root /www/repos/havi/$subdomain;
    index index.php;

    server_name domain.com *.domain.com;

set $subdomain "www";

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


    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi_params;
    }


    location ~ /\.ht 
    {
            deny all;
    }

if ($host ~* ^([a-z0-9-\.]+)\.domain.com$) 
{
    set $subdomain $1;
}

}

And i have no idea why the $_GET array (php) always empty if i tried to set it through the link like:

http://domain.com/action?name=John&age=15

There is empty array coming each time. On my local machine with local Apache server the same code works right.

Help. please ;)

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Change try_files $uri $uri/ /index.php; to try_files $uri $uri/ /index.php?$args; to include the $_GET parameters when you pass the user off to index.php

share|improve this answer
    
Thanks! It works! –  Eugene Mar 27 '13 at 16:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.