Symptoms
-
.html files, including the Default Plesk page (index.html), display a blank page instead of the content. Other static files are also not opened. .php files are opened correctly.
-
Records like the following appear in a Browser Developer Console of a web-browser:
GET https://example.com/A.style.css.pagespeed.cf.IzHunpedlN.css net::ERR_ABORTED 404
(index):45 Uncaught ReferenceError: mod_pagespeed_masdEi5Tr is not defined -
nginx reverse proxy is enabled on the server. Check this in Plesk at Tools & Settings > Services Management.
-
Apache PageSpeed module is installed and loaded. Check this in Plesk at Tools & Settings > Apache Web Server > pagespeed.
Cause
Apache PageSpeed module prevents static files from being served correctly.
Resolution
Apply one of the following solutions:
For best experience, Apache PageSpeed recommends to have static files processed by Apache. To enable this setting, follow the steps:
Disabling smart static files processing via Plesk
-
Go to Domains > example.com > Apache & nginx Settings and disable the option Smart static files processing.
-
Click OK to apply the changes.
Note: It is not possible to manage this option via service plan settings.
To disable smart static files processing by nginx for all newly created domains, apply the following steps:
-
Connect to the server via SSH.
-
Create the sh script with any text editor, for example:
# vi /usr/local/psa/bin/script.sh
-
Add the following lines in the script:
#!/bin/bash
echo "starting" >> /tmp/event_handler.log
plesk bin subscription --update-web-server-settings ${NEW_DOMAIN_NAME} -nginx-transparent-mode true
echo "added ${NEW_DOMAIN_NAME}" >> /tmp/event_handler.log -
Make it executable:
# chmod 755 /usr/local/psa/bin/script.sh
-
Go to Tools & Settings > Event Manager > Add Event Handler
-
Choose "Physical hosting created" as an event and put the following command in the "Command" field:
# sh /usr/local/psa/bin/script.sh
-
Click OK. From now on, all newly created domains will have this option disabled.
Disabling smart static files processing via a command-line interface
Connect to the server via SSH and disable Smart static files processing using the following command:
-
For a domain:
# plesk bin subscription --update-web-server-settings example.net -nginx-transparent-mode true
-
For all domains:
# for subs in `plesk bin site --list`; do echo Processing subscription... $subs; plesk bin subscription --update-web-server-settings $subs -nginx-transparent-mode true; done
If Smart static files processing must remain enabled, turn off Apache PageSpeed module so that it does not interfere with static files processing:
Turning off Apache PageSpeed module via Plesk
-
Go to Tools & Settings > Apache Web Server.
-
Uncheck pagespeed (and pagespeed_ap24 if enabled) and click OK.
Turning off Apache PageSpeed module via a command-line interface
-
Connect to the Plesk server via SSH.
-
Disable Apache mod_pagespeed:
-
on CentOS/RHEL-based distributions
# mv /etc/httpd/conf.d/pagespeed.conf /etc/httpd/conf.d/pagespeed…
-