I want to enable GZIP for the request from outside the network.
I tried config below in nginx.conf But I got "gzip" directive is not allowed here in /etc/nginx/nginx.conf:64 error
nginx.conf
http {
geo $no_gzip_list {
default 0;
10.0.0.0/8 1;
172.16.0.0/12 1;
192.168.0.0/16 1;
}
gzip on;
server {
if ($no_gzip_list = 0) {
gzip off; #<--Line 64
}
}
}
What did I do wrong? or How can I enable gzip for external request and disable gzip for internal request?