• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved ext-pagespeed-insights-task\analyze Forbidden - Requests from referer <empty> are blocked.

karam

Basic Pleskian
Hello Everyone,
Am getting a strange error when using Google PageSpeed Insights in Plesk,

"Forbidden - Requests from referer <empty> are blocked."

*API Key is set to not restrict anything.
I don't understand why it returns the referer <empty> .. any advises ?

Thank you.
 
Thank you @IgorG for respond,
The strange thing it is throwing me <empty>, I have no idea why it does so, the server is brand new, and Plesk is newly updated. and everything is very clean.

I tried the above, and I also completely disabled the API key restrictions. I don't know if there is a problem with the extension it self with plesk..

Note : It worked well in an old build in the server..and I didn't change my behavior in the new clean build.

Kind Regards,
Karam
 
*Update.
I did the following and the problem seems unexpectedly solved.

I generated a new API key from google.
And I re-installed the extension.

Also applied restrictions by IP so no one uses that API but my plesk server.. and it works now..

Just in case someone has the same problem in future. and thanks again @IgorG

Kind regards,
Karam
 
I have been reviewing the documentation and it is most likely that this error is due to IP address restrictions that are enabled for the API key in Google API Console but the server address is not allowed.

By the above, please follow the guide below in order to edit the API key and add the IP of the server:

Google PageSpeed Insights analyze task fails: Forbidden - The calling IP address does not match the IP restrictions configured on the API key
The link provided doesn't take to an active page. Can you please provide solution. Thank you!
 
The link provided doesn't take to an active page. Can you please provide solution. Thank you!
The following symptoms should be there:
  • Google PageSpeed Insights analyze task for the domain in Extensions > My Extensions > Google PageSpeed Insights fails with the following error message:
    Code:
    The task "task\analyze" has failed.
    API request couldn't be executed
    properly. Please try again!
  • The file /var/log/plesk/panel.log contains messages like the following:
    Code:
    ERR [extension/pagespeed-insights] Forbidden - The calling IP address 203.0.113.2 does not match the IP restrictions configured on the API key. Please use the API Console to update
    OR
    Code:
    ERR [extension/pagespeed-insights] Forbidden - The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions.
IP address restrictions are enabled for the API key in Google API Console but the server address is not allowed.

Use the following steps for resolving the issue:
  1. log in to Google API Console and go to the API credentials
  2. Edit the API key. Add the IP of the server to the list at Application restrictions > Accept requests from these server IP addresses. Click Save
    Note:
    It may take up to 5 minutes for settings to take effect
API_console.jpg

For more details refer to the Google API Console Help.
 
Back
Top