Why is NGINX delivering other documented SSI functionality, but not LAST_MODIFIED in the header?
Because nginx haven't fully implement SSI anyway. Quoting the docs:
Currently, the list of supported SSI commands is incomplete.
For a list of supported SSI commands and variables, check nginx's source here.
Edit:
If complete SSI support is desired, try using Apache httpd behind nginx.
according to the NGIX (sic) docs (see the link in my post)
Here's direct quote from ssi_last_modified
docs circa July 21st, 2021:
Allows preserving the Last-Modified
header field from the original response during SSI processing to facilitate response caching.
By default, the header field is removed as contents of the response are modified during processing and may contain dynamically generated elements or parts that are changed independently of the original response.
By default, when responding to a request for a static file, nginx adds Last-Modified
HTTP response header.
When using SSI, nginx remove this header on purpose because nginx is generating the page dynamically instead of returning a static file, therefore adding a Last-Modified
response header is pointless.
ssi_last_modified
directive re-adds Last-Modified
HTTP response header according to SSI script file timestamp.
In no way it said that this directive adds LAST_MODIFIED
variable to nginx's SSI.
LAST_MODIFIED
should still be supported
AFAIK, there's no standard, nor RFCs, that could be relied upon to completely implement SSI. Arguably, docs to mod_include could be such standard, but again, it's only a manual to another product. Let me know if there's such standard and I'll amend this answer.
You'll have better chance resolving this problem by submitting a feature request to nginx's Trac.
Tangent: even if it's supported, if you add LAST_MODIFIED
, should its value be the timestamp of the SSI script, or server timestamp; since the HTML response is generated on-the-fly instead of directly read from a file.
This is for legacy sites I've moved across to NGINX from Apache. Some large sites still use SSI, and it's a useful lightweight way approach, avoiding PHP etc.
I doubt those large sites still use SSI behind the scenes. At this point, SSI is a legacy framework with a lot of alternatives available.