ngx_pagespeed

Install ngx_pagespeed on Amazon Linux

Run the maintained PageSpeed module for nginx on Amazon Linux by building it from source against your nginx. The module is free to install and evaluate; a license is required for production optimization.

Build from source

A signed Amazon Linux package isn't in the repository yet, so on Amazon Linux the maintained module is installed by compiling it against the exact nginx version you run — nginx dynamic modules are version-specific. The from-source walkthrough covers fetching the module, building with --with-compat, and loading the resulting .so.

Build ngx_pagespeed from source

Prefer a prebuilt package?

If a signed prebuilt package is an option for your fleet, the maintained module installs directly on Ubuntu, Debian, and EL9 (AlmaLinux, Rocky, RHEL) from the signed repository. The install hub has the per-distribution commands.

Verify it is running

Once nginx is reloaded with the module enabled, an optimized response carries the X-Page-Speed header:

curl -sI https://yoursite/ | grep -i x-page-speed

A version string in that header means the worker is optimizing. If the header is absent, check that the module is loaded and pagespeed on; is set — the configuration reference walks through it.

1.1 nginx or 2.0 nginx?

Two maintained engines exist for nginx. mod_pagespeed 1.1 keeps the existing pagespeed_* directives, so current configs carry over. ModPageSpeed 2.0 is a new architecture (mmap serving, variant-aware caching, AVIF) for fresh installs.

Compare mod_pagespeed 1.1 vs 2.0 for nginx

Licensing

The module is free to install and evaluate — it fully optimizes and adds an X-PageSpeed-Warn: unlicensed header until a license is applied. A commercial license is required for production use; your site keeps serving either way.