Last active
January 6, 2016 21:15
-
-
Save grimen/dffbc23174cfb33f399f to your computer and use it in GitHub Desktop.
This file contains 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 /validate { | |
# IF: | |
# /validate?param1=value | |
# /validate?param0=x¶m1=value | |
rewrite ^/validate?.*param1\=(.+).*$ /success/$1 last; | |
# ELSE: | |
# /validate?param0=x | |
# /validate?param0=x¶m1 | |
# /validate?param0=x¶m1= | |
rewrite ^/validate?.*$ /fail last; | |
# FALLBACK: Not a case, but just for the cause... | |
return 403; | |
} | |
location ~ /fail { | |
return 400; | |
} | |
location ~ /success/(.+) { | |
return 200 $1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment