[Solved] HowTo setup a subdomain and reverse proxy in FBox?

I set up an gitea instance on my FB which I had installed before on another Homeserver.

I can call it under http://\<local-ip\>:3000 but of course I would like to call it under https://\<mydomain\> or better under the subdomain https://git.\<mydomain> I formerly used.

On my old homeserver I used nginx and a reverse-proxy, expanded my letsencrypt-certs and that went well.
But now I’m completely unaware how to hook the localhost:3000 to https://git.<mydomain> under apache resp. plinth.

If s.o. could give me an example .conf for that task that would be highly appreciated :sweat_smile:

! Btw. I like to recommend gitea as a replacement for gitweb in FB as it is quite lightweight and gives you everything you might be used to from github or gitlab including issue-management. Maybe you want to take a look at it.

Easiest is to have a path under main domain instead of subdomain. Try adding the following /etc/apache2/conf-available/my-gitea.conf:

<Location /gitea/>
    ProxyPass http://localhost:3000/
</Location>

Then

sudo a2enconf my-gitea
systemctl reload apache2

See other configuration files in /etc/apache2/conf-available/ provided by FreedomBox.

1 Like

Yes, that’s definitely easy! :laughing:

For gitea I had to add another line to make it work:

<Location /gitea>
    ProxyPass http://localhost:3000 nocanon
    ProxyPassReverse http://localhost:3000
</Location>

And even if I liked to have a subdomain … That’s fine for me. Especially since all the other services run with a path also. That’s at least a clear standard :wink:

Thanks again for fast and proper help :purple_heart:

Now I have a complete git platform including issue management and ssh again and that is really easy to setup and update.

Update
My former goal of having a proper subdomain is to be solved classically how it’s done with apache servers.

Hi, thanks for posting that really good info.

Is there a proper “official” place to post such expert hints and configs?

Maybe a tweaks section in FreedomBox/QuestionsAndAnswers - Debian Wiki ?

We tend to collect most of the information on the manual pages of the corresponding apps. Anything that is not appropriate there can be gathered on questions and answers page. Feel free to edit the wiki pages.