LOCATION ~ * \ (JPG | GIF | PNG) $ {..
gzip ON (open);
gzip_http_version 1.1 (version);
gzip_comp_level 2 (compression ratio);
gzip_types (file type) text / plain application / javascript application / x-javascript text / CSS file application / XML text / JavaScript file application / X-PHP the httpd-Image / JPEG Image / Image GIF / PNG;
the root / opt / App / code / Images;
}
location ~ ^/download {
gzip_static on(开启);
tcp_nopush on;
root /opt/app/code;
}
.. ~ LOCATION * \ (HTM | HTML) {$
the add_header the Allow-Access-Control-Origin (cross-domain access request domain name) * (represented by all);
the add_header-Access-Control-the Allow Methods (cross-domain access request method ) the GET, the POST, the PUT, the DELETE, the OPTIONS;
Expires 24h (buffer cycle);
the root / opt / App / code;
}