ngx_pagespeed FAQ
Answers from the team that maintains the module.
Is ngx_pagespeed still maintained?
The maintained continuation is mod_pagespeed for nginx, developed by We-Amp — the company that helped build ngx_pagespeed, maintained mod_pagespeed, and drove the project's Apache incubation — with active development, regular releases, and CVE patches. Google's original ngx_pagespeed repository is archived and no longer developed; mod_pagespeed is the maintained nginx module you can install today. Moving an existing install? The migration guide lists what carries over, and the alternative page explains why the archived module no longer builds.
Is ngx_pagespeed free?
Yes. It is open source under the Apache License 2.0 — free to install and run, in development and in production, on any number of servers. No license key, no registration. We do not paywall access to the binary; the packages install from a signed repository We-Amp operates.
Which nginx versions are supported?
The maintained module installs against stock distro nginx builds via
the signed package repository. When
building from source, compile the
module against the source for the exact nginx version you run — nginx
dynamic modules are version-specific, so rebuild when you upgrade
nginx. The --with-compat configure flag does not relax the
version match, so rebuild against the exact nginx you run.
Which Linux distributions are supported?
The maintained module installs from the signed repository on Ubuntu (24.04 and 22.04, amd64 and arm64), Debian (12 and 13, amd64 and arm64; Debian 11 is end of life and no longer supported: upgrade to Debian 12 or later), EL9 — AlmaLinux 9, Rocky Linux 9, and RHEL 9 (x86_64 and aarch64) — and EL10 (x86_64). On other distributions, including Amazon Linux, build the module from source against your nginx — the install hub has the commands for each.
How do I install ngx_pagespeed?
Add the signed repository and install the package, or build from source for a custom nginx. The install hub has the commands for both paths, and the configuration reference covers the minimal directives to get optimization running.
What replaces ngx_pagespeed 1.13.35.2 and 1.14.33.1-RC1?
The archived module is no longer developed, so there is no newer release of it to move to. The maintained continuation is mod_pagespeed for nginx, installed as nginx-module-pagespeed from the signed repository, with its own release line; the release notes list each release and its security fixes. Your pagespeed directives carry over; the migration guide lists what changes.
apt-get says the repository is no longer signed. What do I do?
If the message names dl.google.com/linux/mod-pagespeed, as in The repository 'http://dl.google.com/linux/mod-pagespeed/deb stable Release' is no longer signed (is not signed if the source was never trusted) or EXPKEYSIG 78BD65473CB3BD13 Google Inc. (Linux Packages Signing Authority), it comes from the archived Google repository, which is no longer maintained; its signatures no longer verify on current systems. Do not re-import its key or mark it trusted; disable that source and move to the maintained package. The migration guide covers these messages, including the Enterprise Linux warning Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY.
Why does a .pagespeed. URL return 404?
Most often one of three things. The request never reaches the module: keep the three location blocks from the configuration reference (the .pagespeed. pattern, ^/pagespeed_static/ and ^/ngx_pagespeed_beacon$) in the server that serves the page, and widen [^.]{10} to [^.]{20} if you set UrlSigningKey. Or the module cannot fetch the original file, for example because it was removed or the origin refuses the request. Or the URL is a combined file and one of its inputs failed to fetch: a combined file has no fallback, a single file falls back to the original. The error log usually names the cause; some of these messages appear only at info level. The troubleshooting guide walks through each one.
Does ngx_pagespeed work behind a TLS terminator, load balancer or CDN?
Yes. Have the proxy that ends TLS send proxy_set_header Host $host; and proxy_set_header X-Forwarded-Proto $scheme;, and turn on pagespeed RespectXForwardedProto on; in the nginx that runs the module, so that absolute URLs and the beacon use https. The module reads only X-Forwarded-Proto, not X-Forwarded-Host or X-Forwarded-Port. If a CDN pulls your resources, its origin must be the server that runs the module. The CDN guide has the full setup.
Can I put nginx proxy_cache or Varnish in front of ngx_pagespeed?
Yes. Set pagespeed DownstreamCachePurgeLocationPrefix so that the module lets the cache keep its HTML and purges pages that went out before optimization finished. Have the cache send a PS-CapabilityList request header and include its value in the cache key, so that each client class gets its own copy. And let a small share of requests through with PS-ShouldBeacon set to your DownstreamCacheRebeaconingKey. By default, images also get lower quality for phones and for Save-Data requests, which the class does not cover: set the JpegRecompressionQualityForSmallScreens, WebpRecompressionQualityForSmallScreens, JpegQualityForSaveData and WebpQualityForSaveData directives to -1. Then cache only HTML and tell the cache to ignore the module's Vary header on it (proxy_ignore_headers Vary;), or it keeps a copy per browser. Open-source nginx needs a purge module for the purge step. The downstream caching guide has complete nginx and Varnish configurations.
JavaScript breaks after I enable the module. How do I find out why?
Load the page with ?PageSpeed=off, then with one filter off at a time, for example ?PageSpeedFilters=-combine_javascript, and compare the browser console. Then exclude only what breaks: add data-pagespeed-no-defer to the <script> tag, use pagespeed Disallow "*/path/to/script*"; for a file, or pagespeed DisableFilters in the location that serves the affected pages. The guide has a table of the common console errors; it is on the JavaScript filters page.
Are the open issues in the old ngx_pagespeed tracker fixed?
Some are. The original ngx_pagespeed issue tracker is archived, so
nobody can close an issue there and resolved reports still show as
open. Among those the maintained module resolves: build failures
against newer nginx and glibc, failures building as a dynamic
module, missing ARM64 packages, no packages for your
distribution’s own nginx, a worker spinning at 100% CPU, a
repeated Vary header, and the request for native lazy
loading. The
resolved-issues page
on modpagespeed.com lists each one with the change and the
release that resolved it.