Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created January 19, 2021 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/1fd20a5960ac085d24ba597b258c0b28 to your computer and use it in GitHub Desktop.
Save miguelmota/1fd20a5960ac085d24ba597b258c0b28 to your computer and use it in GitHub Desktop.
NGINX rewrite based on user agent example (eg. curl, wget)
if ($http_user_agent ~* 'curl|wget') {
rewrite ^ http://localhost:8080 permanent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment