Setting Max HTTP Header Size With AJP / Tomcat 6.0

守給你的承諾、 提交于 2019-12-30 08:50:31

问题


If you're not using AJP, Tomcat 6.0 Connectors have a nice maxHttpHeaderSize attribute in server.xml. But if you are using AJP, that attribute is not understood. Is there any way to increase the allowed HTTP header size if you are writing an app that is using AJP?

(maxHttpHeaderSize is documented at http://tomcat.apache.org/tomcat-6.0-doc/config/http.html but there is also this in that document: "If you wish to configure the Connector that is used for connections to web servers using the AJP protocol (such as the mod_jk 1.2.x connector for Apache 1.3), see here instead." The "here" link points to http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html where maxHttpHeaderSize is omitted from the list of attributes.)


回答1:


The AJP protocol is packet oriented, and in the Basic Packet Structure section of mod_proxy_ajp it says:

According to much of the code, the max packet size is 8 * 1024 bytes (8K). The actual length of the packet is encoded in the header.

Send Headers has a packet code of 4, so it appears all the headers need to fit in a single packet with a 8k limit. However, if How to set the AJP packet size in Tomcat? is correct, you can increase that limit.



来源:https://stackoverflow.com/questions/6837505/setting-max-http-header-size-with-ajp-tomcat-6-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!