Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
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