How to create a personal piratebay proxy

You need a VPS. Boot it up, login as root:
cd /root
apt-get install libpcre3 libpcre3-dev zlib1g zlib1g-dev openssl libssl-dev gcc make git socat screen
tar xvf nginx-1.11.13.tar.gz
git clone git://
tar xzvf nginx-nginx-1.10.3.tar.gz
cd ~/nginx-1.11.13
./configure –with-http_ssl_module –add-module=~/ngx_http_substitutions_filter_module
make && make install
cd /usr/local/nginx/

Test by going to the ip address of host.

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

Add the code:

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 server_ip;

    location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;

Start nginx after stopping it:

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

Create a daemon:

emacs ~/
socat tcp4-LISTEN:81,reuseaddr,fork,keepalive,bind= SOCKS4A:,socksport=9050

Run the daemon

screen -A -m -d -S SOCAT_DAEMON ~/

To start it at boot, add to /etc/rc.local