title: nginx configuration for a RESTful API
body: <p>I am a beginner with nginx and php, so please excuse my basic question.</p>
  
  <p>For a RESTful based API (nginx + php) I would need some help with nginx configuration. </p>
  
  <p>Here is the relevant snippet of the nginx configuration (as suggested <a href="http://wiki.nginx.org/Pitfalls#Proxy_Everything">here</a>) for redirecting all /api/v1/* requests to my apiv1.php script:</p>
  
  <pre><code>    server {
          server_name myServer;
          root /usr/share/nginx/html;
          location /api/v1/ {
            try_files $uri $uri/ /apiv1.php?$args;
          }
  
          location ~ \.php$ {
          include fastcgi_params;
          fastcgi_pass unix:/var/run/php5-fpm.sock;
      }
  </code></pre>
  
  <p>Now the issue is that when I type <a href="http://myServer//api/v1/resource/GetInfo">http://myServer//api/v1/resource/GetInfo</a> in my browser, the apiv1.php script doesn't seem to receive the "resource/GetInfo". Actually, _GET and _REQUEST are empty, but _SERVER looks OK! </p>
  
  <p>In my /etc/php5/fpm/php.ini, the following relevant config is enabled:</p>
  
  <pre><code>request_order = "GP"
  variables_order = "GPCS"
  register_argc_argv = Off
  auto_globals_jit = On.
  </code></pre>
  
  <p>Do you maybe know why the php _GET and _REQUEST are empty? Is this related to my php configuration only?</p>
  
  <p>Best regards,
  M.</p>