How to install ea-nginx-cors in CentOS/RHEL 9 (x86_64)
Correct CORS for NGINX, including preflight and Vary
Important: cPanel with EasyApache 4 must be installed on your server before using this repository.
Install
# cPanel with EasyApache 4 must be installed on your server.
sudo dnf -y install https://extras.getpagespeed.com/release-latest.rpm
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --enable getpagespeed-extras-ea4
sudo dnf -y install ea-nginx-cors
Description
Correct CORS for NGINX, including preflight and Vary 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. This module is built for cPanel EasyApache 4 (EA4) nginx compatibility.
Compatibility
This package is compatible with all RHEL-based distributions, including CentOS, AlmaLinux, Oracle Linux, Rocky Linux, etc.
RPMs
| Package | Size | Built | Changes |
|---|---|---|---|
| ea-nginx-cors-1.31.3+1.0.0-1.gps.el9.x86_64 | 18 KiB | 2026-08-15 | no changelog |