Oddbean new post about | logout
 In principle, it's the same as making any TCP service accessible from tor 
there's many guides available for this, the basic steps are to install tor, then add to /etc/tor/torrc:

HiddenServiceDir /var/lib/tor/nostr_relay/
HiddenServicePort 80 127.0.0.1:8081

We're using port 80 instead of 443 because using TLS behind Tor is only a hassle in most cases (Tor already provides equivalent encryption). Where to redirect it depends on how your relay is configured.

In my case i use nostr-rs-relay (listening on 127.0.0.1:8081). In front of this i have nginx reverse-proxying to provide TLS. However, because nginx isn't really doing anything useful there, i can redirect Tor to its local HTTP port directly. Easy but YMMV.

Another option if you do want Tor connections to go through say, nginx (for example if you're providing extra pages or services on the domain), would be to add another plain http service port (say, port 81, then make Tor connect there), specifically configured for the onion HTTP. But that's web server specific. 
 got it. thanks a lot. i try to add it in immo configs as well.