I have a question but I accept other suggestions that bypass this feature.
Basically I'm sending big lines of text ~3000 characters to my server in a get request and the server sends it to google translate as params in a url.
The problem: Nginx throws me a 502 bad gateway error when the url is > 1900 characters.
How can I increase the limit of my nginx url?
Alternative Solution: Sending a post request with the 3000 characters in a JSON as a string?
Does 502 bad gateway mean blocked? If your computer screen displays an error message stating “502 bad gateway”, it means the server which is acting as a proxy or gateway is not getting adequate response from another server. But this is a generic error, you won't be able to find out the root cause.
To answer your question, there is a setting you can change in the nginx.conf file containing your server's configuration.
Set the following setting to something that seems fitting to your situation:
large_client_header_buffers 4 16k;
Find the documentation for it here.
I would suggest to use a POST request in case your ~3000 character requests get bigger and your nginx configuration reaches it limit.
The important thing to notice here is that a 502 error is a problem downstream. You're probably using nginx as a reverse proxy, and it's the service that you're forwarding to which is failing.
In my case, I was using nginx to forward traffic to a docker instance which was using uwsgi. So I needed to up the 'buffer-size' parameter in my uwsgi configuration. But your specific solution will depend on the service that you're forwarding to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With