1

I am running a wordpress blog and in the clear net and I want for it to be accessible from Tor as well. Kinda like how Facebook has both a normal and a onion address.

I have read the one way to do that is to run a clone of your website at the same time, just with a different address. That however is very resource heavy. Are there any other ways?

Any help, tips or suggestions greatly appreciated.

2
  • How are you running the blog, are you running the server yourself? If so what software are you using?
    – Steve
    May 12, 2020 at 8:30
  • Hi steve, I am locally hosting wordpress using ngnix
    – mse88999
    May 14, 2020 at 17:51

3 Answers 3

0

Here's the problem. There is nothing stopping you from adding an onion service to a normal webserver. However, what about the links on your page? If your Tor users click on a link will it take them to an .onion page or to a clearnet page and vice versa. This is why it is best to run websites in parallel. If you are awesome at writing Wordpress plugins, you might be able to set up some kind of "smart" plugin that will present a different copy of each page depending on if the user is using Tor or nor otherwise it is best to run two copies.

VPS servers are super cheap. If running two instances of wordpress is "very resource heavy" then you might want to find a better provider.

2
  • Hi Evans thank you for your comment. What good and affordable vps providers do u suggest? Thanks
    – mse88999
    May 14, 2020 at 17:56
  • Just adding a reference for the issue JSEvans mentioned: lapsedordinary.net/2016/01/24/…. In short it should be easy to do, the problem is just finding a good Wordpress plugin to support multiple domains.
    – Steve
    May 14, 2020 at 18:09
1

I was able to achieve this on my Wordpress site (being served with NGINX) by doing the following:

This assumes you have already setup your Wordpress site to use https with a clearnet domain on nginx.

  1. In your /etc/tor/torrc file, add the following:
    HiddenServiceDir /var/lib/tor/exampleonion
    HiddenServicePort 80 127.0.0.1:8022 #Replace 8022 with another port if you want. NOT 443 or 80
  1. Get your onion site address by running:
sudo cat /var/lib/tor/exampleonion/hostname
  1. Create a new nginx file in /etc/nginx/sites-available/ name it example.onion.conf or whatever you want

  2. In the file add this then restart nginx:

server {

  listen putyourtorporthere; 
  server_name youronionaddresshere.onion; 
#The rest should be the same as your clearnet Wordpress site

   root /var/www/example.com/wordpress/; 
   index index.php;  
   location / { 
                try_files $uri $uri/ /index.php?$args;
        }
   location ~ \.php$ { 
                include snippets/fastcgi-php.conf;
                fastcgi_pass wp-php-handler;
        }
}
  1. Visit your site using the CLEARNET domain and install and activate the Multiple Domain plugin by goINPUT IT Solutions.

  2. In the Settings-General panel, add your onion domain under the Multiple Domain settings. BE SURE TO SELECT HTTP instead of "Auto" for your onion site since onion certs are not currently easily available.

  3. Test your site in the Tor browser using the onion domain.

  4. To add the "Onion available" message on Tor, add the following to your CLEARNET Nginx config.

  add_header X-Frame-Options DENY;
  add_header X-Content-Type-Options nosniff;
  add_header Onion-Location http://youronionaddresshere.onion$request_uri;
  1. Restart nginx and visit the CLEARNET domain in Tor to see if the banner appears once the site loads.
0

In your Nginx configuration, you want to point an Onion address to another website using a proxy pass. Below is the modified configuration for your scenario:

nginx

# Listen on Onion address and redirect to another website
server {
    listen 8080;
    server_name 3nqth62o7x37iyckbsvypqv4ts2fqnrfo3ugqzdurapz6a4tdb2tztad.onion;
    
    location / {
        proxy_pass https://sayches.com;
    }
}

and other way could be

# Server block for clearnet (HTTP)
server {
    listen 80;
    server_name example.com www.example.com;

}

# Server block for Onion (Tor)
server {
    listen 127.0.0.1:80; # Listen only on localhost
    server_name abced.onion;

    # Proxy to your web server (e.g., Apache or another Nginx instance) running on port 80
    location / {
        proxy_pass http://localhost:80;
    }

}

both way tested and in use

1
  • look at this its tested and working 2 days ago

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .