Skip to content

Instantly share code, notes, and snippets.

@7ute
Created July 31, 2023 09:04
Show Gist options
  • Save 7ute/418a5a4ac2cbb999f243ec06ab7b55fc to your computer and use it in GitHub Desktop.
Save 7ute/418a5a4ac2cbb999f243ec06ab7b55fc to your computer and use it in GitHub Desktop.
Redirect and strip query parameters in NGINX
if ($request_uri ~ "([^\?]*)\?unwantedParam=(.*)") {
rewrite ^ "https://www.example.org?" permanent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment