The main reason was the great virtual-hosts support (You just put a directory with the domain name in the dir and its rendered on it, no reload or anything!)
Heres some instructions on how I did that, on GNU/Linux.
Firstly, one of the hurdles i came across was that the instructions at the [git repo](https://tildegit.org/solene/vger) were very BSD-focused.
In our setup, vger runs on the PubNixVM and the TLS Termination Proxy runs on the tilserv.
To install vger, I git clon'd the repo, then ran `nix-shell` to get a shell with all the deps I need. After that I just ran `./configure` and `make`, like any old unix program.
To start vger though, is a lot more weird. It cannot be started standalone, instead you have to start it through inetd (or an equivalent like xinetd).
I went with Xinetd, and used its nix service to set it up.
This translated to a Xinetd.conf that looks like this :-
```
defaults
{
log_type = SYSLOG daemon info
log_on_failure = HOST
log_on_success = PID HOST DURATION EXIT
}
service vger
{
protocol = tcp
type = UNLISTED
socket_type = stream
port = 11965
wait = no
user = gemini
server = /var/gemini/vger/vger
server_args = -v -i
}
```
Additionally, I enabled syslog with `services.syslogd.enable = true;` and set `ForwardToWall=no` in journald.conf (`services.journald.extraConfig = "ForwardToWall=no";`) so that it won't spam my terminal every time someone visits the capsule.
With a quick nixos-rebuild switch, vger is running on port 11965.
`-v` flag enabled virtual hosts. This means when you visit aryak.vern.cc, vger will look for the directory /var/gemini/aryak.vern.cc.
But if you try to visit localhost:11965 with any gemini client, it will just give you a TLS error.
This is because vger does not handle TLS, instead out-sourcing that to relayd, which hasn't been ported to GNU/Linux.
So, instead of that, I used this simple (100 LOC) Go project called [TLSify](https://github.com/tlsify/tlsify)
Its really simple, just run `tlsify tcp4 :11965 tcp4 :1965 /path/to/cert.pem /path/to/privkey.pem`