Enable gzip with Apache Tomcat proxy connector

都博裕
2023-12-01

vim /etc/apache2/vhosts.d/00_default_vhost.conf
<VirtualHost *:80>
Servername localhost
DocumentRoot "/home/mg/opt/tomcat/webapps/cityunion"
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /*.jpg !
ProxyPass /*.png !
ProxyPass /*.gif !
ProxyPass /*.htm !
ProxyPass /*.html !
ProxyPass /*.js !
Proxypass /*.exe !

ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
# Enable gzip with Apache Tomcat proxy connector
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
image/jpeg image/png image/gif
</VirtualHost>



vim conf/server.xml
<Connector port="8080" protocol="HTTP/1.1"
maxHttpHeaderSize="8192" useBodyEncodingForURI="true" URIEncoding="UTF-8"
maxThreads="30"
redirectPort="8443"
enableLookups="false"
compression="on"
compressionMinSize="2048"
compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain,image/gif,image/jpeg,image/png"
connectionTimeout="20000"
disableUploadTimeout="true" />
 类似资料:

相关阅读

相关文章

相关问答