How to create mirror in Tor with .onion domain?


I’m using a standard installation of Docker Discourse on Ubuntu with clearnet domain and want to setup a forum mirror in .onion Tor network.

I have installed Tor on server and now I have example.onion address.

But it’s not work :pensive:

My steps:

  1. apt install tor
  2. edit file /etc/tor/torrc
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80
HiddenServiceVersion 3

When I change port 8080 to 80, my example.onion domain redirict to

3. restart

systemctl restart tor
systemctl enable tor

4. check my onion domain

cat /var/lib/tor/hidden_service/hostname

5. go to cd /var/discourse/ and edit app.yml

add templates web.onion.template.yml
add DISCOURSE_ONION look like:

DISCOURSE_ONION example.onion

This web.onion.template.yml on GitHub

  1. ./launcher rebuild app

Please help :pleading_face: :pray:

Hello and welcome to the forum.

I suppose that’s the only problem.
Nginx receives the request on port 80, and is configured to forward all requests to port 443 to respond via HTTPS. So my guess.

You must either open another port in Nginx, such as 8080 that does not forward to 443, or remove the forwarding.

Find the line where the redirect is configured. I would first try to disable the forwarding as follows:

if ($remote_addr != {
  return 301 https://$host$request_uri;