Nginx URL限制502网关 [英] Nginx url limit 502 gateway

查看:134
本文介绍了Nginx URL限制502网关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,但是我接受其他绕过此功能的建议.

I have a question but I accept other suggestions that bypass this feature.

基本上,我会在get请求中向我的服务器发送大行文本〜3000个字符,然后服务器将其作为url中的参数发送给Google翻译.

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.

问题:当url> 1900个字符时,Nginx向我抛出502错误的网关错误.

The problem: Nginx throws me a 502 bad gateway error when the url is > 1900 characters.

如何增加Nginx网址的限制?

How can I increase the limit of my nginx url?

替代解决方案:以JSON中的3000个字符作为字符串发送发布请求?

Alternative Solution: Sending a post request with the 3000 characters in a JSON as a string?

推荐答案

为回答您的问题,您可以在包含服务器配置的nginx.conf文件中进行更改.

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;

此处找到相关文档.

我建议您使用POST请求,以防您的〜3000个字符请求变大并且您的nginx配置达到限制.

I would suggest to use a POST request in case your ~3000 character requests get bigger and your nginx configuration reaches it limit.

这篇关于Nginx URL限制502网关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆