This guide will explain how to set up your own Pirate Bay proxy site. A proxy site will help users in countries where The Pirate Bay has been blocked.

For most of the article we'll be using a web server called NGINX. NGINX is our recommended method since it is fast, requires few resources, and has many advanced reverse proxy features. It has been tested on Red Hat based and Debian based distributions but it works on pretty much all UNIX-based systems. Your server should not have anything else running on port 80 though, and of course it needs sufficient bandwidth. Don't use a precompiled binary from your distributions repos (e.g. apt-get install package) since it will not have the required modules.

There are also two PHP scripts that proxy The Pirate Bay that have been designed specifically for this and can be used on web hosting packages (i.e. does not require a server dedicated to it).


1. Once you have your server online you will want to get NGINX compiled and installed.

To do this, we will first need to install some packages.

a) If you're using a Debian based OS (e.g. Ubuntu), run this:

apt-get install libpcre3 libpcre3-dev zlib1g zlib1g-dev openssl libssl-dev gcc make git

b) If you're using a Red Hat based OS (e.g. Centos), run this:

yum install pcre-devel zlib-devel openssl-devel gcc make subversion

2. Now that the packages are installed, we will download the NGINX source code to the /tmp/nginx directory and compile it.

You can find the latest version here.

mkdir -p /tmp/nginx;cd /tmp/nginx

3. We need to download the substitutions module in order to make text and regex replacements with the proxy.

Clone the Github repository with the following command.

git clone git://

4. Extract the source.

tar xzvf nginx-1.12.2.tar.gz;cd nginx-1.12.2

5. Now we can configure NGINX. Ensure that the substitutions module folder path is correct.

See this link for more configuration options.

./configure --with-http_ssl_module --add-module=/tmp/nginx/ngx_http_substitutions_filter_module

6. Now we can compile and install NGINX. It will be installed to /usr/local/nginx/ by default.

make && make install

7. Test if NGINX is working by starting it

Note: If logged in as root, you don't need the sudo command

sudo /usr/local/nginx/sbin/nginx

8. Check if it's working by typing in your server IP in your web browser. You should see the "Welcome to NGINX!" message.

If it's working, stop NGINX with the following command now so we can configure it.

If it's not working, ensure nothing else is running on port 80 (link) or try checking Google for a solution.

sudo /usr/local/nginx/sbin/nginx -s stop

9. Rename the default config file so we've got a copy of the original config

cd /usr/local/nginx/conf;mv nginx.conf nginx.conf-backup

10. Copy the following config and insert it into nginx.conf using a text editor such as nano or vi. (e.g. nano nginx.conf).

For more information on how to configure NGINX, see this link.

worker_processes auto; events {worker_connections 1024;} http { include mime.types; default_type application/octet-stream; sendfile on; gzip on; server { listen 80; server_name; location / { proxy_pass; proxy_set_header Accept-Encoding ""; proxy_set_header Host; proxy_set_header CF-Connecting-IP ""; subs_filter '<a href="/help" title="How do I download?">How do I download?</a>' '<a href="" title="Proxy List">More Pirate Bay Proxy Sites</a>'; subs_filter '<a href="/login" title="Login">Login</a> |' ''; subs_filter '<a href="/register" title="Register">Register</a> |' ''; subs_filter '' $host; } location /login {return 403;} location /register {return 403;} } }

11. Test your config works by starting NGINX with the following command.

If you see an error, try checking inputting the error in Google for solutions. You can also check the error log by going to /usr/local/nginx/logs/.

sudo /usr/local/nginx/sbin/nginx

12. You can test if it works by going to your domain in your browser or running the following curl command on your server.

curl -H 'Host:' localhost

If it works then submit it to The Proxy Bay by going to This Link.

13. You should now setup an init script to load NGINX when your server starts.

You can find startup scripts for different distributions here. Be sure to change the paths to match where your NGINX installation is located


These two PHP scripts are designed specifically for providing access to The Pirate Bay. A great solution if you do not have a server that you can dedicate to the task. They require PHP5 and cURL.

Unblocked Pirate Bay PHP Script

This is the recommended PHP script that proxies The Pirate Bay. This script does not use .htaccess and is likely to be more compatible with web servers

Since it doesn't make use of .htaccess, the URL path will be appended by ?load=/. For example:

Simply upload it to your web host and modify includes/config.php. You can also customize the home page by editing home.html

Download from Github here

PHP The Pirate Bay Proxy

This script uses .htaccess to load the proxy script and modify the URL's. Therefore, your server will need to run Apache for the .htaccess file to work

If the script doesn't work, make sure the .htaccess file exists in the same directory as proxy.php. You can also try removing the RewriteBase line from the htaccess file as well to see if that helps. Otherwise, try the alternative script below

To install, just unzip it and upload the files to your web server.

Download from Github here


Find a good Web Host

Try looking for a provider that ignores DMCA requests and is not based in the USA or UK. Some hosts (even in Europe) will honour DMCA takedowns, so it's good to do your research. Try doing a Google search for keywords such as: offshore, vps, dmca.

Use a CDN

Use a free CDN service such as Cloudflare to help speed up your site and lessen the load on your server. It will also conceal the true location of your server.

Note: If you are using Cloudflare, you will need to add proxy_set_header CF-Connecting-IP ''; to your Nginx config for it to work. Otherwise, you will get DNS errors


Aside from protecting the privacy of your users, using SSL can also bypass a lot of blocks from ISP's. Therefore, it is highly recommended to use SSL for your proxy

Cloudlfare automatically provides an SSL certificate for your site so you can simply add https in front of your domain.

If you buy your own certificate, be sure to follow the SSL best practices, such as enabling HSTS and using modern ciphers. Here is a guide for NGINX


NGINX is the fastest and most reliable proxy method available. The PHP scripts should be used if you are unable to setup NGINX

Take a look at the NGINX Documentation to further configure it to your needs

Here is a guide on how to optimize NGINX

Find a good Domain Registrar

I recommend Hover, EasyDNS, or NameCheap.

Avoid GoDaddy,, Network Solutions and

It's also good to avoid certain domain registries such as Donuts, Radix, or any UK based domain registry.

Use WHOIS privacy on your domain name

When you register a domain name, your billing/registration information usually becomes public in the public WHOIS database. Therefore, anyone can go on a Whois search site and lookup your domain.

Some domain names do not support WHOIS privacy and will require your contact details to be public. In that case, you can try inputting fake data. However, be aware that this might be against the terms of your domain registration. Here is More information.

Get a Free Domain Name

Using FreeDNS, you can register a free subdomain name (e.g. This is free and doesn't require you to register or pay for a regular domain. However, since it's a subdomain, you don't control the name servers and cannot use it with services like Cloudflare

Another option is to get a free domain from Freenom. Since these are regular domains (e.g., you can set up name servers to point at services such as Cloudflare

Monitor your site

Here are some free options to monitor the uptime of your site: Montastic,, Uptime Robot

Check for updates

In the case that something changes with the TPB servers or setup, you may need to update the config or code to make the proxy work. If you're using the PHP script, you can monitor the Github page. Othewise, for NGINX, check this page occasionally for updates

What next?

Once you have set up your proxy and can confirm it is working, submit it to The Proxy Bay

Submit your proxy