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
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    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?

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
  • Try setting `LogLevel trace3`, and look in the error log. It should give you information about which virtual host and proxy configuration are being used. – Andrew Schulman Apr 24 '21 at 15:39
  • Are you sure gitea is https? It use http by default, have you checked it via browser? – kab00m Apr 24 '21 at 19:02

0 Answers0