Fix Nginx & Optimize Magento 2

Job ID: 39616170

Budget: $10 – $30 USD

Project Overview:
We are looking for an expert Magento 2 Developer / System Administrator to resolve two specific, pre-diagnosed performance bottlenecks on our live eCommerce site. The ideal freelancer must be experienced with Nginx, LiteSpeed, and Magento's core architecture.

Our Current Stack:

Magento Version: 2.4.7-p4

Server: Hetzner Dedicated Server with cPanel/WHM

Web Server: Nginx (as a reverse proxy) + LiteSpeed Web Server (for PHP processing)

Cache: LiteMage, Redis

CDN: Cloudflare

We have already performed extensive debugging and have pinpointed the exact causes of our performance issues.

Problem #: Incorrect Vary: User-Agent Header (Server Issue)

Symptom: Our Cloudflare Cache Hit Ratio is extremely low (~9%), with ~90% of requests being served as DYNAMIC.

Diagnosis: Using curl tests that bypass Cloudflare, we have confirmed that our origin server's Nginx layer is incorrectly adding a Vary: User-Agent header to all static asset responses (images, CSS, JS). This is "shattering" our Cloudflare cache. We have already confirmed this is not caused by any Cloudflare settings (Rocket Loader, Mirage, Polish, etc., are all off) or .htaccess rules. The directive is not explicitly found in the Nginx configuration files we have access to, suggesting it's a default behavior of the cPanel/EasyApache Nginx build.

Required Task: Your first task is to modify the server's Nginx configuration to remove the Vary: User-Agent header for all static file responses.
Related categories: PHP Linux Magento Nginx Redis Cloudflare cPanel System Administration