Limiting gzip_static to two directories

I have gzip enabled in Nginx as well as gzip_static. I am trying to
limit
gzip_static to just one or two sections. There are pre-compressed files
inside the directory: media/po_compressor/ along with sub directories of
this such as:
media/po_compressor/4/js
media/po_compressor/4/css

Here is what I have below in nginx. What is the best way to look inside
directory and sub-directories using location entry?

Gzip Static module to compress CSS, JS

location /media/po_compressor/ {
gzip_static on;
expires 365d;
add_header Pragma public;
add_header Cache-Control “public, must-revalidate, proxy-revalidate”;
}

Compression

gzip on;
gzip_buffers 16 8k;
gzip_comp_level 4;
gzip_http_version 1.0;
gzip_min_length 1280;
gzip_types text/plain text/css application/x-javascript
text/xml
application/xml application/xml+rss text/javascript image/x-icon
image/bmp;
gzip_vary on;

Posted at Nginx Forum:

changing location line to:

location ^~ /media/po_compressor/ {

should allow it to look for all files within this directory and
sub-directories, right?

Posted at Nginx Forum:

According to the location
http://nginx.org/en/docs/http/ngx_http_core_module.html#location
directive documentation, nginx will match one location block only.
nginx will first match the longest prefix location to your request.
If that longest prefix is the one you provided, then regular expression
won’t be checked, as you used the special modifier doing that.
If that longest prefix is another location rule, then nginx will
remember
it, search for regex locations matches, stop at the first one matching
or
revert back to the longest prefix lcoation found earlier.

So, if you have no longer prefix location matching those URIs, then the
files will be served by it.

B. R.