Last active
November 9, 2016 12:54
-
-
Save michaelkarrer81/9c3545f04be64fc90464fdb4d8a01984 to your computer and use it in GitHub Desktop.
Nginx retain query!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location /some/location { | |
# check, if any query strings are available | |
if( $args = '' ) { | |
# no query found, so... | |
return 301 /destination/url/; | |
} | |
# if it reaches here, then query is found, so... | |
return 301 /destination/url/?$args; | |
} | |
#Even better: | |
location /some/location { | |
return 301 /destination/url/$is_args$args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Even better:
location /some/location {
return 301 /destination/url/$is_args$args;
}