location /api { rewrite ^/api/(.*)$ /api/api.php?x=$1 last; }