Gzip if in location example

Syntax: gzip on | off;
Default: gzip off;
Context: http, server, location, if in location

Is there an example of this “if in location” usage ?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,252407,252407#msg-252407

This I suppose:

    location / {
        try_files $uri $uri/ =404;
        if ($scheme = http) { gzip on; }
        index  index.html index.htm;
    }

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,252407,252409#msg-252409