Hi
I am trying set a value for expire with a combination in my nginx configuration. we need to set expire for objects in a specified location of nginx configuration to have expire at every 2 hours and also at 24hours. As of now the configuration looks as follows,
location ~* "^.+\.(jpe?g|gif|css|png|js|ico|pdf|zip|tar|t?gz|mp3|wav|swf)$" {
expires 2h;
add_header Cache-Control public;
}
Is it possible to have expires for 2 timings like expires 2h | @24h; . Using | doesnt seems to be working. Is it possible to achieve the same with max age ? I would appreciate any help on the same.
The version and module status is as follows.
root@ip-mymachine# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.9.6
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --add-module=/opt/nginxmodules/headers-more-nginx-module-0.28 --add-module=/opt/nginxmodules/ngx_http_substitutions_filter_module --add-module=/opt/nginxmodules/ngx_pagespeed-release-1.9.32.10-beta --with-http_ssl_module
root@ip-mymachine#
Thanks
RGR
I am trying set a value for expire with a combination in my nginx configuration. we need to set expire for objects in a specified location of nginx configuration to have expire at every 2 hours and also at 24hours. As of now the configuration looks as follows,
location ~* "^.+\.(jpe?g|gif|css|png|js|ico|pdf|zip|tar|t?gz|mp3|wav|swf)$" {
expires 2h;
add_header Cache-Control public;
}
Is it possible to have expires for 2 timings like expires 2h | @24h; . Using | doesnt seems to be working. Is it possible to achieve the same with max age ? I would appreciate any help on the same.
The version and module status is as follows.
root@ip-mymachine# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.9.6
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --add-module=/opt/nginxmodules/headers-more-nginx-module-0.28 --add-module=/opt/nginxmodules/ngx_http_substitutions_filter_module --add-module=/opt/nginxmodules/ngx_pagespeed-release-1.9.32.10-beta --with-http_ssl_module
root@ip-mymachine#
Thanks
RGR