Hello,
For the benefit for those using arm64 architecture, i would like to share the process i used to make Pagespeed work in ubuntu 24.04 and nginx 1.24. I believe the process should work on earlier versions of ubuntu and nginx.
If you already installed nginx you will need to uninstall it from the aapanel and reboot.
After the reboot, add the below code on compile while re-installing/installing nginx
Module Name: ngx_pagespeed
Module Details: ngx_pagespeed
Module Parameter: --add-dynamic-module=/www/server/incubator-pagespeed-ngx
Script:
cd /www/server/
git clone https://github.com/apache/incubator-pagespeed-ngx.git
cd incubator-pagespeed-ngx
wget https://gitlab.com/gusco/ngx_pagespeed_arm/-/raw/master/psol-1.15.0.0-aarch64.tar.gz
tar -xzvf psol-1.15.0.0-aarch64.tar.gz
sed -i 's/x86_64/aarch64/' config
sed -i 's/x64/aarch64/' config
sed -i 's/-luuid/-l:libuuid.so.1/' config
After a successful installation of nginx, you may need to reboot the instance/server.
Go to the nginx configuration page and add the below code at the top
load_module modules/ngx_pagespeed.so;
Further add your Pagespeed filters under http {
Mine is as below, alter as you need
pagespeed on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
#Disable CoreFilters
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters collapse_whitespace;
pagespeed EnableFilters canonicalize_javascript_libraries;
pagespeed EnableFilters combine_css;
pagespeed EnableFilters combine_javascript;
pagespeed EnableFilters elide_attributes;
pagespeed EnableFilters extend_cache;
pagespeed EnableFilters flatten_css_imports;
pagespeed CssFlattenMaxBytes 5120;
pagespeed EnableFilters lazyload_images;
pagespeed EnableFilters rewrite_javascript;
pagespeed EnableFilters insert_dns_prefetch;
pagespeed EnableFilters prioritize_critical_css;
#Example Disable pagespeed processing/wp admin/directory (optional configuration, refer to)
pagespeed Disallow "/wp-admin/";
#######Image Processing Configuration########
pagespeed EnableFilters lazyload_images;
pagespeed EnableFilters rewrite_images;
pagespeed EnableFilters convert_jpeg_to_webp;
pagespeed EnableFilters convert_to_webp_animated;
pagespeed EnableFilters inline_preview_images;
#Mobile terminal image
pagespeed EnableFilters resize_mobile_images;
pagespeed EnableFilters responsive_images,resize_images;
pagespeed EnableFilters insert_image_dimensions;
pagespeed EnableFilters resize_rendered_image_dimensions;
pagespeed EnableFilters strip_image_meta_data;
pagespeed EnableFilters convert_jpeg_to_webp,convert_to_webp_lossless,convert_to_webp_animated;
pagespeed EnableFilters sprite_images;
pagespeed EnableFilters convert_png_to_jpeg,convert_jpeg_to_webp;
Save and restart the nginx server, and you should be good to go.
Check headers or https://ismodpagespeedworking.com/ to verify Pagespeed is working.
Should you need to clear the cache delete the files in /var/ngx_pagespeed_cache
I hope this will help someone.