Masalah ini cukup membingungkan karena sebelumnya situs dapat diakses dengan normal. Panduan ini akan menjelaskan penyebab utama, serta memberikan langkah-langkah perbaikan permanen yang direkomendasikan.
Tim Apache telah merilis perbaikan untuk CVE yang memengaruhi fungsionalitas Apache + nginx: Tidak mengizinkan permintaan proses Apache dari nginx tanpa server name (secara default, nginx tidak meneruskan server name melalui SNI saat membuat koneksi dengan reverse proxy).
Berikut kutipan dari Apache CVE-2024-42516
1 2 3 4 5 6 7 8 9 10 11 | Fixed in Apache HTTP Server 2.4.64 moderate: Apache HTTP Server: HTTP response splitting (CVE-2024-42516) HTTP response splitting in the core of Apache HTTP Server allows an attacker who can manipulate the Content-Type response headers of applications hosted or proxied by the server can split the HTTP response. This vulnerability was described as CVE-2023-38709 but the patch included in Apache HTTP Server 2.4.59 did not address the issue. Users are recommended to upgrade to version 2.4.64, which fixes this issue. Reported to security team: 2024-07-18 Update 2.4.64 released: 2025-07-10 Affects 2.4.0 through: 2.4.63 |
Penyebab Error
Error ini disebabkan oleh perubahan perilaku Apache versi terbaru, terutama saat menggunakan protokol HTTP/2. Apache kini menjadi lebih ketat dalam menangani koneksi HTTP/2 ke virtual hosts (vhosts).
Secara teknis, error 421 muncul jika permintaan HTTP/2 ditujukan ke vhost yang tidak sesuai dengan nama server dalam header TLS (SNI). Jika Apache tidak menemukan nama host yang cocok saat melakukan handshake TLS, maka ia akan mengembalikan error 421.
- Website menampilkan error
421 Misdirected Request - Hanya terjadi pada website dengan sertifikat SSL yang dibagikan (shared) atau subdomain tanpa sertifikat tersendiri
- Situs bekerja normal jika diakses melalui HTTP biasa atau jika HTTP/2 dinonaktifkan
Solusi untuk NGINX Reverse Proxy Apache
Tambahkan parameter berikut pada NGINX Virtualhost
1 2 | proxy_ssl_server_name on; proxy_ssl_name $host; |
Jika Menggunakan cPanel:
Cara ini hanya untuk instalasi cPanel yang menggunakan NGINX dari paket ea-nginx dan cPanel secara resmi sudah mengeluarkan update terbaru untuk errror 421 Missdirected:
1 2 3 4 5 6 7 | * Fri Jul 18 2025 - ea-apache24 - 2.4.64-3 - EA-13041: Rolling “ea-apache24” back to “35b37d6c7295199c5157c68145f220d9fa61ff02”: Apache v2.4.64 broke SNI (rando 421) * Fri Jul 18 2025 - ea-nginx - 1.26.3-11 - EA-13040: Remove SNI fix as we've removed the offending changes in ea-apache24 for now. |
Jalankan perintah berikut untuk update cPanel:
1 | /scripts/upcp --force |
Update AlmaLinux:
1 2 | dnf clean all dnf update ea-* |
Update Ubuntu:
1 | apt upgrade |
Jika menggunakan Plesk:
- Masuk ke panel Plesk Anda.
- Buka Tools & Settings di menu sebelah kiri.
- Di bawah grup “General Settings”, klik Apache & Nginx Settings.
- Gulir ke bawah untuk menemukan kotak teks berlabel Additional Nginx directives.
- Paste dua baris berikut ke dalam kotak itu:
proxy_ssl_server_name on;proxy_ssl_name $host; - Klik OK atau Apply. Plesk akan secara otomatis menyimpan konfigurasi dan restart Nginx. Situs web Anda sekarang seharusnya sudah kembali online.
Jika menggunakan HestiaCP:
Anda dapat menjalankan perintah berikut untuk melakukan perubahan secara otomatis:
1 2 | for file in $(grep -l proxy_pass /usr/local/hestia/data/templates/web/nginx/*.stpl); do if ! grep -q proxy_ssl_server_name "$file"; then sed -i '/proxy_pass/ i\\t\tproxy_ssl_server_name on;\n\t\tproxy_ssl_name $host;' "$file"; fi; done for i in $(v-list-users plain | cut -f1); do echo "Rebuilding web domains for user $i"; v-rebuild-web-domains $i yes; done |
Untuk email domain:
1 2 | for file in $(grep -l proxy_pass /usr/local/hestia/data/templates/mail/nginx/*.stpl); do if ! grep -q proxy_ssl_server_name "$file"; then sed -i '/proxy_pass/ i\\t\tproxy_ssl_server_name on;\n\t\tproxy_ssl_name $host;' "$file"; fi; done for i in $(v-list-users plain | cut -f1); do echo "Rebuilding mail domains for user $i"; v-rebuild-mail-domains $i yes >/dev/null; done |
Sumber: https://forum.hestiacp.com/t/nginx-apache-ssl-421-misdirected-request/19502/4
![[ Apache ] Solusi Error “421 Misdirected Request” 1 Focusnic - [ Apache ] Solusi Error “421 Misdirected Request”](https://focusnic.com/blog/wp-content/uploads/2025/07/421-apache.png)
![[cPanel/WHM] - Cara mengedit Update URL untuk WP Toolkit 3 [cPanel/WHM] - Cara mengedit Update URL untuk WP Toolkit](https://focusnic.com/blog/wp-content/uploads/2025/06/update-url-wp-toolkit-cpanel.png)
![[cPanel/WHM] - Solusi PHP Deprecated: Directive allow_url_include is deprecated in Unknown on line 0 14 [cPanel/WHM] - Solusi PHP Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0'](https://focusnic.com/blog/wp-content/uploads/2025/05/cpanel-whm-solusi-php-deprecated-directive-allow-url-include-is-deprecated-in-unknown-on-line-0.png)
![[cPanel/WHM] - Cara Mengaktifkan Software Statistik cPanel 17 [cPanel/WHM] - Cara Mengaktifkan Software Statistik cPanel](https://focusnic.com/blog/wp-content/uploads/2025/05/cpanel-whm-cara-mengaktifkan-software-statistik-cpanel.png)