How To Create Your Own Pirate Bay Proxy Site
Running your own Pirate Bay proxy means operating a server that fetches pages from a working TPB domain and serves them under your own name. You control uptime, branding, and access. This guide covers Nginx (preferred) and PHP approaches, practical tips for keeping a mirror alive, and when to choose a proxy over a VPN.
Choosing a proxy server for The Pirate Bay
There are three practical options. A hosted unblocking proxy is zero-maintenance but shared and occasionally slow. A reverse proxy (nginx on a cheap VPS, forwarding to a working TPB mirror) is private and fast. A self-hosted web proxy app sits in between. Whatever you pick: choose a VPS in a country that doesn't block TPB, keep HTTPS on everything, and expect bandwidth to be your real cost.
Reverse-proxy setup outline
Nginx is the preferred method for a production proxy. It is quick, battle-tested, and its reverse-proxy features match this workload. You run nginx on a VPS, set it to fetch pages from a working TPB upstream, and rewrite any embedded upstream domain references to your own domain as content passes through.
Minimum requirements
- A Linux VPS with at least 2 GB RAM and 2 cores, running Debian or Ubuntu, with bandwidth to match your expected traffic.
- Port 80 free for the HTTP listener.
- Nginx with substitution support to rewrite upstream domain references in HTML. Prebuilt distro packages omit this module, so you either install from a third-party repo or compile from source.
Configuration template
This is a minimal but complete server block. Replace upstream.piratebay.domain with a currently working TPB mirror (check our proxy list). The subs_filter directives rewrite any appearance of the upstream domain in the response body to your own domain.
worker_processes auto;
events {
worker_connections 1024;
}
http {
limit_req_zone $binary_remote_addr zone=tpb_proxy:10m rate=10r/s;
include mime.types;
default_type application/octet-stream;
sendfile on;
gzip on;
server {
listen 80;
server_name yourdomain.com;
limit_req zone=tpb_proxy burst=20 nodelay;
location / {
proxy_pass https://upstream.piratebay.domain/;
proxy_set_header Accept-Encoding "";
proxy_set_header Host upstream.piratebay.domain;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_ssl_verify off;
proxy_ssl_server_name on;
subs_filter 'upstream.piratebay.domain' $host;
subs_filter 'https://upstream.piratebay.domain' 'https://$host';
}
location ~* \.(css|js|png|jpg|jpeg|gif|webp|svg|woff2?)$ {
proxy_pass https://upstream.piratebay.domain;
proxy_cache_valid 200 7d;
expires 7d;
}
}
}
Rate limiting: The limit_req_zone and limit_req directives protect your proxy from runaway traffic. Adjust the rate (10r/s) and burst (20) based on your VPS capacity.
Caching: Static assets (CSS, JS, images) are cached for 7 days. This reduces load on the upstream and speeds up repeat visits.
Running it
- Install nginx (from your distro package manager or compiled from source with the substitution module).
- Replace the stock
nginx.confwith the template above. - Start nginx and visit your domain. Check the nginx error log under
/var/log/nginx/if pages load but contain broken links. - When working, submit your proxy to our list.
- Set up a systemd unit or init script so nginx starts on boot.
Method 2: PHP mirror
If you are on shared hosting rather than a VPS, a PHP script can proxy TPB pages without requiring custom nginx modules.
PHP-based proxies fetch TPB pages server-side via cURL, then rewrite any upstream domain references and serve the modified HTML to visitors. This approach has lower performance overhead but ties you to the host's PHP configuration and rate limits.
Several community scripts exist. Look for ones that handle image proxying and that strip or rewrite external links. Avoid scripts that inject ads or trackers.
Tips for a worry-free proxy site
CDN and caching considerations
Putting Cloudflare or another CDN in front of your proxy has tradeoffs:
- What to cache: CSS, JavaScript, and images can be cached aggressively (7+ days). Do not cache HTML pages that contain dynamic user data.
- Abuse protection: A CDN absorbs DDoS traffic and keeps your VPS IP hidden.
- SSL termination: Free-tier Cloudflare provides SSL, so you don't need to manage certificates on the VPS.
Keeping the mirror alive
Proxy mirrors face three challenges: upstream downtime, domain rotation, and hosting abuse notices.
Upstream monitoring: Set up uptime monitoring (a simple script that hits your proxy every 5 minutes and alerts you via email or webhook) and keep a shortlist of alternates. When one upstream dies, edit your nginx config and reload.
Domain rotation: Expect to update the upstream domain in your config every few weeks. Bookmark your proxy list for current working mirrors.
Hosting stability: Research hosting providers before buying. A provider with a strict acceptable-use policy means repeated downtime.
Proxy or VPN?
A self-run proxy reroutes browsing traffic but does not encrypt your whole connection or hide peer traffic from your ISP. It is excellent for accessing TPB in a region where the site is blocked, and it gives you a consistent private URL across devices.
For downloading torrents, a proxy alone is insufficient. You need a VPN that allows P2P traffic. See our VPN for Torrenting guide for established options with audited no-logs policies.
If you want the zero-setup alternative, use the health-checked mirrors on our Pirate Bay proxy list.