A user, prostasia, sought help configuring Discourse to be a Tor hidden service using nginx. Initially, their configuration didn’t work, but after switching from using a socket to a port, they were able to get it working.
prostasia shared that they have a 2GB Digital Ocean VM with 105 users and didn’t make any modifications for performance over Tor, except for a plugin to allow serving it over Tor and clearweb simultaneously.
jughead reported issues with user images taking a long time to load over Tor, and jughead also asked about setting the X-Forwarded-For header in nginx to show Tor user addresses. rollerbob suggested using the set_real_ip_from directive to set the real IP address for Tor users.
Other users, such as pfaffman, provided links to relevant documentation, but prostasia found the approach too complicated for their needs.
I would like to configure Discourse to be a Tor hidden service using nginx. Here is the configuration that I am trying in nginx (it doesn’t work, “server not found”):
And in /var/lib/tor/hidden_service I have the hostname and private key files. Tor is running.
Discourse is installed and working on the clearweb, and /var/discourse/shared/standalone/nginx.http.sock exists.
If needed I’m happy to pay someone for an hour or so of work to get this running (I doubt it will take more than that, because I’m probably just being stupid).
Yes but honestly I can’t make head or tail of it and it seems an over-complicated approach for what I need, which is just a working nginx configuration.
Yes, here is the working configuration. The problem was pretty simple, it was that originally I tried to use a socket to serve the site, but this didn’t work, so I had to use a port.
It’s a 2Gb Digital Ocean VM with 105 users. We didn’t make any modifications (except a plugin to allow us to serve it over tor and clearweb simultaneously).
Another question, do you have any issues with user images (like background card, profile banner, etc) taking a really long time to load (I suppose this is because of tor). After it’s cached though it shows it just fine.
I’m not exactly sure how tor user addresses work. But for me all the user logged ip’s show as 127.0.0.1 which I’d expect but I have set the x-forwarded-for header in nginx.
I’m not sure whether tor users have something similar to an ip over the tor network itself, and how I get this to show.