nginx – Server doesn’t respond to If-Modified-Since
I get the following error on a Drupal & site running on PHP-FPM/NGINX set up.
Server returned the last modification time, but did not respond to
If-Modified-Since.
So basically Nginx is responding with 200, when it should be responding with 304.
Output from the curl –
curl -I -H “If-Modified-Since: Mon, 06 Feb 2023 06:31:44 GMT” -X GET
www.example.com HTTP/2 200 server: nginx date: Mon, 06 Feb
2023 07:18:52 GMT content-type: text/html; charset=utf-8 vary:
Accept-Encoding etag: “16756xx650xx38-0” content-language: en
x-frame-options: SAMEORIGIN x-content-type-options: nosniff link:
www.example.com.au; rel=”canonical” cache-control: public,
max-age=0 last-modified: Mon, 06 Feb 2023 06:30:38 GMT expires: Sun,
19 Nov 1978 05:00:00 GMT vary: Cookie vary: Accept-Encoding
strict-transport-security: max-age=15768000
I am running following Nginx config:
github.com/perusio/drupal-with-nginx/blob/D7/apps/drupal/drupal.conf
I can’t get a 304 even on static resources being served directly by Nginx.
Read more here: Source link