Skip to content

Instantly share code, notes, and snippets.

@joakimk
Last active August 29, 2015 14:23
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 joakimk/18dd80f6f62ad6fb230b to your computer and use it in GitHub Desktop.
Save joakimk/18dd80f6f62ad6fb230b to your computer and use it in GitHub Desktop.
Nginx "Bad Request" 400 error because of % in the body text?

If you have a body like this:

payload={"data": "5 %"}

Then nginx will most likely give you a 400 bad request error.

To get around this, encode the json with "x-www-urlencoded" encoding.

A web framework like rails will transparently decode "x-www-urlencoded" for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment