My web server (apache2) is accessible on my LAN with its host name, let's say, jarvis
(url: http://jarvis/
).
I have a Gitea instance running in my local network which is accessible via http://jarvis:3000
. It obviously runs on the same machine as the webserver does and runs inside a Docker container (just as the webserver does) with container name, let's say, gitea
. They share the same docker network so the web server can access the gitea instance through http://gitea:3000
.
In my Pi-hole, I've set up a local DNS entry http://git.home/
which routes to the IP address of my web server jarvis
on 192.168.154.x
. Now, what I want is to configure apache2 to route access via this domain to http://gitea:3000
.
So, I decided to alter my 000-default.conf
as follows:
<VirtualHost *:80>
#...
</VirtualHost>
<VirtualHost git.home:80>
ServerName git.home
ProxyPass / http://gitea:3000/
ProxyPassReverse / http://gitea:3000/
</VirtualHost>
Now, when browsing to http://git.home/
I keep getting to the web server root page instead of the Gitea instance.
What did I do wrong with the reverse proxy configuration? Is there anything I should keep in mind when creating reverse proxies for local domains?