Skip to content

Instantly share code, notes, and snippets.

@johnvilsack
Created August 28, 2012 22:00
Show Gist options
  • Save johnvilsack/3504717 to your computer and use it in GitHub Desktop.
Save johnvilsack/3504717 to your computer and use it in GitHub Desktop.
Get URL Query String in NGINX
// URL Rewriting in NGINX strips query parameters. This is a way to work around the problem.
// Written specifically for use in klein.php
function getURLQuery()
{
$url = parse_url($_SERVER['REQUEST_URI']);
parse_str(urldecode($url['query']), $url['query']);
return $url['query'];
}
print_r(getURLQuery());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment