Steps to Enable SSLProxyEngine in Apache

SSLProxyEngine is required when Apache acts as a reverse proxy and forwards requests to a backend that serves HTTPS. Without it, requests to HTTPS backends fail with a 502 Proxy Error — the proxy simply refuses to establish an SSL connection to the upstream server.

1. Open the Apache Configuration File

sudo nano /etc/apache2/sites-enabled/your-site.conf # Ubuntu/Debian
 sudo nano /etc/httpd/conf/httpd.conf               # CentOS/RHEL

2. Enable SSLProxyEngine

Add the following line inside the <VirtualHost> block that contains your ProxyPass directives:

SSLProxyEngine on

Example with an HTTPS backend:

<VirtualHost *:443>
  ServerName example.com
  SSLProxyEngine on
  ProxyPass / https://backend.internal:8443/
  ProxyPassReverse / https://backend.internal:8443/
 </VirtualHost>

3. Test and Reload Apache

sudo apachectl configtest
 sudo systemctl reload apache2   # Ubuntu/Debian
 sudo systemctl reload httpd     # CentOS/RHEL

Run apachectl configtest before reloading — it reports syntax errors without interrupting the running server.

Common Errors

Related Articles

A.M. Rinas

Written by A.M. Rinas

Full-Stack Software Engineer working on web applications, DevOps automation, and databases. More about me on the about page, or say hi through the contact page and LinkedIn.

← Back to all articles