How to install sw-nginx-module-cors on Debian
Correct CORS for NGINX, including preflight and Vary
Availability
Compare package tracks by distribution and architecture. Checkmarks show the architectures available in each repository channel.
| Distro | Channel | amd64 | Version |
|---|---|---|---|
| Debian 13 (trixie) | Base | 1.30.6.1+1.0.0+p18.0.82.1.t261027.1716 | |
| Debian 12 (bookworm) | Base | 1.30.6.1+1.0.0+p18.0.82.1.t261027.1716 |
Description
CORS module for NGINX that handles the parts the add_header recipe gets wrong. Preflight OPTIONS requests are answered internally and never reach the upstream. Origin matching supports exact lists, wildcard subdomains and regular expressions, with Access-Control-Allow-Credentials refused at configuration time when it would be paired with a wildcard origin the browser rejects. Access-Control-* headers are emitted on error responses too, so a failing request surfaces the real status instead of an opaque CORS failure. Vary: Origin is emitted whenever the response depends on the request origin, which keeps shared caches and CDNs correct. Premium module by GetPageSpeed.
Built for Debian.
Install
sw-nginx-module-cors on Debian 12 (bookworm), 13 (trixie)
curl -fsSL https://extras.getpagespeed.com/release-latest.deb -o /tmp/getpagespeed-release.deb sudo apt-get install -y /tmp/getpagespeed-release.deb rm /tmp/getpagespeed-release.deb sudo apt-get update sudo apt-get install -y sw-nginx-module-cors
Package downloads require an active GetPageSpeed subscription — one repository for sw-nginx-module-cors and thousands more packages for Debian.
Subscribe — from $10/moOther releases and channels: use the setup wizard.
Frequently asked questions
How do I install sw-nginx-module-cors on Debian?
Add the GetPageSpeed repository, then install the sw-nginx-module-cors package with your system package manager.
Which Debian versions is sw-nginx-module-cors available for?
sw-nginx-module-cors is available for Debian 12, 13.