Skip to content

Instantly share code, notes, and snippets.

@wolfg1969
Created September 7, 2012 09:58
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 wolfg1969/3664769 to your computer and use it in GitHub Desktop.
Save wolfg1969/3664769 to your computer and use it in GitHub Desktop.
ngx_set_misc example: redirect to a url specified by query parameter.
location /go {
set_unescape_uri $new_url $arg_url;
if ( $new_url ~* ^[^(http://)](.*)$ ){
return 302 http://$new_url;
}
return 302 $new_url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment