Complete the code to set the Expires header to 1 day.
expires [1];The expires directive with 1d sets the Expires header to 1 day in the future.
Complete the code to disable the Expires header.
expires [1];Setting expires off; disables the Expires header, so no caching is done.
Fix the error in the code to set Expires header to 10 minutes.
expires [1];The preferred syntax for 10 minutes is 10m. Forms like 10minutes and 10min are invalid in nginx; 600s is valid but 10m is more common.
Fill both blanks to set Expires header to 2 hours and disable it for a specific location.
location /images/ {
expires [1];
}
location /nocache/ {
expires [2];
}Setting expires 2h; caches for 2 hours. Setting expires off; disables caching.
Fill all three blanks to set Expires header with a variable, a time, and disable caching conditionally.
set $cache_time [1]; if ($request_uri ~* ".*\.css$") { expires [2]; } else { expires [3]; }
We set $cache_time to '1d'. CSS files have caching disabled with 'off'. Others use the variable $cache_time.