Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does GKE Ingress-GCE support compression?

My backend, in Rocket (Rust), does not have compression built in. So, it is dependent on the proxy to compress it. Though nginx ingress controller supports it, I thought whether the default one had it too as it has high availability.

If it does not have, then how should I setup?

like image 600
pepsighan Avatar asked Jan 26 '26 15:01

pepsighan


1 Answers

UPDATE(2018-01-31): It looks like Cloud HTTP(S) Load Balancer supports GZIP. You just have to serve compressed content from your backend and the load balancer will pass it on.

However, NGINX is confused because of the Via header (it thinks proxies don't support GZIP, and on most cloud providers this is correct, but not Google). See this FAQ: https://cloud.google.com/cdn/docs/troubleshooting#compression-not-working

If you are using the nginx web server software, modify the nginx.conf configuration file to enable compression. The location of this file depends on where nginx is installed. In many Linux distributions, the file is stored at /etc/nginx/nginx.conf. To allow nginx compression to work with HTTP(S) load balancing, add the following two lines to the http section of nginx.conf:

gzip_proxied any;
gzip_vary on;
like image 156
ahmet alp balkan Avatar answered Jan 29 '26 13:01

ahmet alp balkan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!