我在Rocket(Rust)的后端没有内置压缩功能.因此,它依赖于代理对其进行压缩.尽管nginx入口控制器支持它,但我认为默认的控制器是否也具有它,因为它具有高可用性.
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?
推荐答案更新(2018-01-31):似乎Cloud HTTP(S)负载均衡器支持 > GZIP.您只需要从后端提供压缩的内容,负载均衡器就会将其继续传递.
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.
但是,NGINX因Via标头而感到困惑(它认为代理不支持GZIP,并且在大多数云提供商上,这是正确的,但不是Google).请参阅以下常见问题解答: cloud.google/cdn/docs/troubleshooting#compression-not-working
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: cloud.google/cdn/docs/troubleshooting#compression-not-working
如果使用的是Nginx Web服务器软件,请修改nginx.conf 配置文件以启用压缩.该文件的位置 取决于nginx的安装位置.在许多Linux发行版中, 文件存储在/etc/nginx/nginx.conf中.允许nginx压缩为 使用HTTP(S)负载平衡,请将以下两行添加到 nginx.conf的http部分:
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;
更多推荐
GKE Ingress
发布评论