`
marlgl
  • 浏览: 71566 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Enable gzip with Apache Tomcat proxy connector

阅读更多
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" />


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics