I want to redirect a certain sub-path to a backend application running at port 19011. My config file (/etc/apache2/sites-available/my_domain.conf
) looks like this:
<VirtualHost *:80>
ServerName my_domain
DocumentRoot /var/www/my_domain
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPass /my_subpath/ http://localhost:19011/
ProxyPassReverse /my_subpath/ http://localhost:19011/
</VirtualHost>
<VirtualHost *:443>
SSLEngine On
SSLProxyEngine On
SSLCertificateFile /etc/letsencrypt/live/my_domain/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/my_domain/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
ServerName my_domain
DocumentRoot /var/www/my_domain
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPass /my_subpath/ http://localhost:19011/
ProxyPassReverse /my_subpath/ http://localhost:19011/
</VirtualHost>
This configuration works with HTTP, but not with HTTPS:
http://my_domain/my_subpath
goes to the backend app as intended, whereashttps://my_domain/my_subpath
returns 404
I am an apache noob, so I don't know why this doesn't work. I also don't see any errors in the apache logs. What am I missing in the conf file?
Versions:
- Apache: 2.4.29
- OS: Ubuntu 18.04.5