I have NGINX SSI working fine in the virtualHosts file (code below) but LAST_MODIFIED
is returning "(none)", although the NGINX docs for SSI state that the ssi_last_modified
directive appeared in version 1.5.1 (we’re running version 1.14.2).
VirtualHost file:
…
location / {
ssi on;
ssi_last_modified on;
…
}
…
and in the .html file:
<!--#if expr="$footer_id='blackfooter'" --><div id="blackfooter"><!--#else --><div id="footer"><!--#endif -->
<!--#config timefmt="%A %d %B %Y" --><p>Updated: <!--#echo var="LAST_MODIFIED" --> | Today: <!--#echo var="DATE_LOCAL" --></p>
</div>
So for now, I've resorted to JavaScript:
<!--#if expr="$footer_id='blackfooter'" --><footer id="blackfooter"><!--#else --><footer><!--#endif -->
<!--#config timefmt="%A %d %B %Y" --><p>Updated: <span id="updated"></span> | Today: <!--#echo var="DATE_LOCAL" --></p>
</footer>
<script>
let lastmod = new Date(document.lastModified);
updated.innerHTML = lastmod.toString().substring(4,15);
</script>
Why is NGINX delivering other documented SSI functionality, but not LAST_MODIFIED
in the header?
The only possible clue I found was that the sub_filter_last_modified
is mentioned in the docs for the NGINX ngx_http_sub_module but AFAIK (and I'm not NGINX specialist) I'm not sure that helps much.