In the control panel Domain -> Web Features I see bits that relate to the headers and expires lines I found in /opt/configs/apache/conf/domains/mtc1.uk.conf.
I tried setting "Static Files Expire" to -1 for the domain, but did not see a difference for the php files.
I have tried commenting out the line:
LoadModule expires_module modules/mod_expires.so
in /etc/httpd/conf.modules.d/00-base.conf, and that stops the expired headers for everything,
So php files work normallly, but the useful caching is lost.
With mod_expires back in again, I tried editing
/opt/configs/apache/conf/domains/mtc1.uk.conf
In the web section for my domain:
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header always set X-XSS-Protection "1;mode=block"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set Access-Control-Allow-Origin "*"
Header always set X-Supported-By "Kloxo-MR 7.0"
RequestHeader unset Proxy early
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/x-icon "access plus 7 days"
ExpiresByType image/gif "accesss plus 7 days"
ExpiresByType image/png "access plus 7 days"
ExpiresByType image/jpg "access plus 7 days"
ExpiresByType image/jpeg "access plus 7 days"
ExpiresByType text/css "access plus 7 days"
ExpiresByType application/pdf "access plus 7 days"
ExpiresByType text/x-javascript "access plus 7 days"
ExpiresDefault "access plus 7 days"
</IfModule>
Changing the text in "X-Supported-By" did not show up in the headers.
Trying ExpiresDefault "access plus 1 seconds"
did not change the headers for php.
Changes to this file don't seem to take effect after a restart-web.
Am I editing the wrong place?
I have tried this in a .htacccess file, but did not see any difference:
---
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
<FilesMatch \.php$>
# Do not allow PHP scripts to be cached unless they explicitly send cache
# headers themselves. Otherwise all scripts would have to overwrite the
# headers set by mod_expires if they want another caching behavior. This may
# fail if an error occurs early in the bootstrap process, and it may cause
# problems if a non-Drupal PHP file is installed in a subdirectory.
ExpiresActive Off
</FilesMatch>
</IfModule>
---
That was from a Drupal installation, and looked useful.
For now the quick fix is to disable mod_expires. I hope the default configuration can be changed so it doesn't affect dynamic files.