Question

Unblock a website using ngnix

HI, I want to set up the same website as https://unblockit.kim/

After asking for a support on GitHub they advise me to run The best method is by using NGINX as per the instructions here: https://proxy-bay.net/setup.html. Instead of using TPB as the domain, you can use any other website you wish to unblock. You can modify the subs_filter setting in the configuration to search and replace the content served by the site.

As per a hosting plan, you would need a VPS/Dedicated/Cloud Linux server that provides SSH access. I just bought a server on the digital ocean and successfully installed the Nginx.

https://proxy-bay.dev/setup.html#Nginx

What change do I make in the config file? Can you please provide me server configuration?

I just place the nigix config file and place the same thing currently I am using the IP address instead of the domain name.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello,

Yes indeed, you can follow the steps provided in the tutorial that you’ve shared.

As per the tutorial, your Nginx configuration would look like this:

worker_processes auto;
events {worker_connections 1024;}
http {
  include mime.types;
  default_type application/octet-stream;
  proxy_ssl_server_name on;
  sendfile on;
  gzip on;

  #Logs
  access_log logs/access.log;
  error_log logs/error.log;

  server {
    listen 80;
    server_name yourdomain.com;

    #Redirects
    proxy_redirect https://thepiratebay.org http://$host;
    proxy_redirect http://thepiratebay.org http://$host;

    #Other URI's
    location = / {return 301 /index.html;}
    location /session {return 302 /;}
    location ~ /torrent/(?<myvar>[0-9]+)/ {return 301 /description.php?id=$myvar;}
    location ~ /search/(?<myvar>.+)/0/ {return 301 /search.php?q=$myvar;}

    #Root URI
    location / {
      proxy_pass https://thepiratebay.org;
      proxy_set_header Host thepiratebay.org;
      proxy_set_header Referer 'https://thepiratebay.org';
      proxy_set_header Accept-Encoding "";
      proxy_set_header CF-Connecting-IP "";

      #Substitutions
      subs_filter_types 'application/javascript';
      subs_filter '<a href="http://piratebayztemzmv.onion" title="tor address">TOR</a> |' '<b><a href="https://proxy-bay.dev" title="Proxy List">Proxy List</a></b> |';
      subs_filter 'https://torrindex.net' "http://$host/torrindexp";
      subs_filter 'https://apibay.org' "http://$host/apip";
      subs_filter '<a href="/session/" title="Login/Upload">Login/Upload</a> |' '';
      subs_filter '<a href="/session/" title="Register">Register</a>' '';
      subs_filter '<a href="/session/" title="Login">Login</a> |' '';
      subs_filter '<a href="" title="Register">Register</a>' '';
      subs_filter 'https://thepiratebay.org' http://$host;
      subs_filter 'thepiratebay.org' $host;
    }

    #API URI
    location /apip/ {
      proxy_pass https://apibay.org/;
      proxy_set_header Host apibay.org;
      proxy_set_header Referer 'https://thepiratebay.org';
      proxy_set_header Accept-Encoding "";
      proxy_set_header CF-Connecting-IP "";
    }

    #Recent URI
    location /apip/precompiled/data_top100_recent.json {
      proxy_pass https://apibay.org/precompiled/data_top100_recent.json;
      proxy_set_header Host apibay.org;
      proxy_set_header Referer 'https://thepiratebay.org';
      proxy_set_header Accept-Encoding "";
      proxy_set_header CF-Connecting-IP "";
    }

    #Torrindex URI
    location /torrindexp {
      proxy_pass https://torrindex.net/;
      proxy_set_header Host torrindex.net;
      proxy_set_header Referer 'https://thepiratebay.org';
      proxy_set_header Accept-Encoding "";
      proxy_set_header CF-Connecting-IP "";
    }
  }
}

You would just need to change the yourdomain.com part with your actual domain name.

Hope that this helps. Best, Bobby