#StackBounty: #apache-2.4 #gzip Apply Apache GZIP on proxied resources

Bounty: 50

I’m running an asp.net application on a Kestrel server. The front facing server is Apache. I’m have trouble applying gzip compression on the proxied resources, although any other resources served directly from Apache and not Kestrel are compresses normally using gzip. Below is myhttp.conf, not sure what im missing, help please.

# Admin email, Server Name (domain name) and any aliases
ServerAdmin yehiasalam@cube.com
ServerName  app.cube.com
ServerAlias  www.app.cube.com
DocumentRoot /var/www/cube/app

# Exclude the /widget folder from the proxy
<Location /widget>   
    ProxyPass !    
    Header set Access-Control-Allow-Origin "*"
</Location>

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5000/
ProxyPassReverse / http://127.0.0.1:5000/

RewriteEngine on 
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC] 
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC] 
RewriteCond %{REQUEST_URI} !^/widget/
RewriteRule /(.*) ws://127.0.0.1:5000/$1 [P]
                                                     
# Gzip everything
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Set the logs
ErrorLog /var/www/cube/app/error.log
CustomLog /var/www/cube/app/access.log common



Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.