View this package for all CentOS/RHEL versions →
How to install sw-nginx-module-cors in CentOS/RHEL 9 (x86_64)
Correct CORS for NGINX, including preflight and Vary
Install
sudo dnf -y install https://extras.getpagespeed.com/release-latest.rpm sudo dnf -y install sw-nginx-module-cors
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. After installation, enable this module by running: plesk sbin nginx_modules_ctl --enable cors
Compatibility
This package is compatible with all RHEL-based distributions, including CentOS, AlmaLinux, Oracle Linux, Rocky Linux, etc.
RPMs
| Package | Size | Built | Changes |
|---|---|---|---|
| sw-nginx-module-cors-1.30.6+1.0.0-4.el9.pl18.gps.x86_64 | 26 KiB | 2026-10-26 | no changelog |