1

I want to proxy git.example.com to example.com:3000 for gitea. I also want to enable https on the subdomain.

Here is my configuration:

<VirtualHost *:443>
    ServerAdmin webmaster@example.com
    ServerName git.example.com
    ServerAlias www.git.example.com
SSLEngine on
SSLCertificateFile     /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile  /etc/letsencrypt/live/example.com/privkey.pem

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLProxyEngine On
ProxyPreserveHost On
ProxyRequests off
&lt;Proxy *&gt;
    Order allow,deny
    Allow from all
&lt;/Proxy&gt;
AllowEncodedSlashes NoDecode
ProxyPass        /git https://localhost:3000/ nocanon
ProxyPassReverse /git https://localhost:3000/

</VirtualHost>

When I restart apache and go to my website, instead of git.example.com going to port 3000, it goes to the main website and any links redirects to an error:

Proxy Error
The proxy server could not handle the request

Reason: Error during SSL Handshake with remote server

Apache/2.4.38 (OS) Server at git.example.com Port 443

The main domain now goes to port 3000. How do I fix this?

0 Answers0