Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have nginx configured like this:

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

    server_name *;

set $subdomain "www";

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

    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_index index.php;
            include fastcgi_params;

    location ~ /\.ht 
            deny all;

if ($host ~* ^([a-z0-9-\.]+)\$) 
    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:

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
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


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.