Hi. I’m having troubles reaching a docker container behing apache reverse proxy using cloudflare, I’m getting a 520 error.
This is the virtual host config on the apache 2 instance:
<VirtualHost *:80>
ServerName sub.example.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =sub.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName sub.example.com
ServerAlias sub.example.com
LoadModule proxy_http_module modules/mod_proxy_http.so
SSLProxyEngine On
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/sub.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/sub.example.com/privkey.pem
ProxyPreserveHost On
ProxyPass / https://localhost:8014/
ProxyPassReverse / https://localhost:8014/
</VirtualHost>
And this is the config of the virtual host inside the docker container apache instance:
<VirtualHost *:80>
ServerName sub.domain.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =sub.domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName sub.domain.com
ServerAlias localhost
<Directory /var/www/html>
AllowOverride All
</Directory>
SSLEngine On
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM- SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
SSLHonorCipherOrder off
SSLSessionTickets off
SSLOptions +StrictRequire
SSLCertificateFile /etc/apache2/fullchain.pem
SSLCertificateKeyFile /etc/apache2/privkey.pem
</VirtualHost>
Could the issue be in the ServerName and that I’m creating some kind of loop requests by not using localhost in the right place?