[ssl:error] AH01961: SSL Proxy requested for app.example.com:443 but not enabled [Hint: SSLProxyEngine]
[proxy:error] AH00961: HTTPS: failed to enable ssl support for 10.0.0.25:8443 (backend.internal)
Quick fix: your ProxyPass points at an https:// backend, but Apache hasn't been told to use TLS for outgoing proxy connections. Add SSLProxyEngine on to the same <VirtualHost> as the ProxyPass, make sure mod_ssl is loaded, and reload:
<VirtualHost *:443>
ServerName app.example.com
# ... your existing SSLEngine / certificate lines ...
SSLProxyEngine on
ProxyPass /api/ https://backend.internal:8443/api/
ProxyPassReverse /api/ https://backend.internal:8443/api/
</VirtualHost>
sudo apachectl configtest && sudo systemctl reload apache2 # httpd on RHEL-based systems
Visitors see 500 Internal Server Error until it's fixed.
Why it happens: Apache uses two separate TLS settings. SSLEngine on makes Apache a TLS server for browsers. SSLProxyEngine on makes it a TLS client towards your backend. Both are off by default, and having one on doesn't turn on the other.
1. Make sure the modules are loaded
You need mod_proxy, mod_proxy_http and mod_ssl:
apachectl -M | grep -E 'proxy_module|proxy_http_module|ssl_module'
If one is missing:
# Debian / Ubuntu
sudo a2enmod proxy proxy_http ssl
sudo systemctl restart apache2
# RHEL / Rocky / AlmaLinux (proxy modules ship with httpd; mod_ssl is a separate package)
sudo dnf install -y mod_ssl
sudo systemctl restart httpd
2. Put SSLProxyEngine on in the right place
The directive must be in the same virtual host as the ProxyPass that uses https://. A common mistake: it's added to the port-443 virtual host while the proxying actually happens in the port-80 one, or the other way round.
It's also needed when browsers reach Apache over plain HTTP and only the backend uses HTTPS:
<VirtualHost *:80>
ServerName internal-proxy.example.com
SSLProxyEngine on
ProxyPass / https://secure-origin.internal:8443/
ProxyPassReverse / https://secure-origin.internal:8443/
</VirtualHost>
SSLProxyEngine isn't allowed inside <Location> or .htaccess. Put it directly in the <VirtualHost> (or the main server config).
3. After enabling it: backend certificate errors (502)
Once Apache talks TLS to the backend, it checks the backend's certificate. By default (Apache 2.4):
| Check | Directive | Default | Fails when |
|---|---|---|---|
Host name matches the ProxyPass host | SSLProxyCheckPeerName | on | You proxy to an IP or a name the certificate doesn't cover |
| Certificate not expired | SSLProxyCheckPeerExpire | on | The backend certificate has expired |
| Certificate chain trusted | SSLProxyVerify | none | Not checked unless you set require |
A failure shows up as 502 Bad Gateway, with a handshake error in the log (for example AH00898: Error during SSL Handshake with remote server).
Fix it properly:
- Name mismatch: proxy to the host name on the certificate, not the IP (
https://backend.internal:8443/), and make that name resolve on the Apache server, for example with an/etc/hostsentry. - Expired backend certificate: renew it on the backend.
- To verify the chain too (recommended when the backend is reached over a network you don't fully control):
SSLProxyVerify require
SSLProxyCACertificateFile /etc/ssl/certs/internal-ca.pem # the CA that signed the backend cert
Development only: you can switch the checks off. Don't do this in production: it lets anyone between Apache and the backend impersonate the backend.
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
4. Test the backend's TLS from the Apache server
openssl s_client -connect backend.internal:8443 -servername backend.internal </dev/null 2>/dev/null \
| openssl x509 -noout -subject -ext subjectAltName -enddate
This shows which names the backend certificate covers and when it expires: the two things Apache checks by default.
To see where a slow or failing request spends its time:
curl -o /dev/null -s -w 'code %{http_code} connect %{time_connect}s tls %{time_appconnect}s ttfb %{time_starttransfer}s\n' \
https://app.example.com/api/health
5. Checklist
apachectl -Mlistsproxy_module,proxy_http_moduleandssl_module.SSLProxyEngine onis in the same<VirtualHost>as thehttps://ProxyPass.- The
ProxyPasshost name matches the backend certificate, and the certificate isn't expired. apachectl configtestsaysSyntax OK, then reload.- Watch
/var/log/apache2/error.log(or/var/log/httpd/error_log) forAH01961,AH00961orAH00898.
6. Notice the next one before users do
This error usually appears right after a config change, a migration to an HTTPS backend, or a backend certificate renewal. Two checks catch it:
- An HTTP monitor on the proxied URL (for example
https://app.example.com/api/health): a 500 or 502 fails the check. - SSL expiry tracking on your public domain, so the front-end certificate never expires unnoticed. Apache's checks cover the backend certificate.
Pingzo runs both: HTTP checks every 1 to 15 minutes depending on your plan, daily SSL expiry checks with warnings at 30, 14, 7 and 1 days, and alerts to WhatsApp, Slack, Telegram, Discord or email. To inspect a certificate right now, use the free SSL inspector.
Stop Finding Out About Outages from Angry Users
Get instant WhatsApp & Discord alerts the second your API, website, or server goes down. Setup in 30 seconds, with checks as often as every minute.