简体   繁体   中英

enable gzip compression for Apache running in docker container

I want to enable gzip compression for an application that is served by an Apache instance running inside a Docker container. I'm using the httpd Alpine image as the base image for my Dockerfile.

I followed this post, enabled deflate_module and appended the shown code to my httpd.conf to only compress certain filetypes.

When I restart Apache with apachectl -k restart and open the served page, the content does not get gzipped (Content-Encoding Response Header is not set) although deflate_module get's loaded (checked with apachectl -M ).

Am I missing an important step to enable the gzip compression?

Any help on this would be great!

Maybe you can enable compression using .htaccess

Look at this . Maybe you can take an idea from there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM