If you use Nginx+Apache2, you can follow the steps and use the templates in this post:
If you use only Nginx you can use one of the existing templates like forgejo
forgejo