Guest User

The Pirate Bay Apache vhost proxy config

a guest
Jan 11th, 2012
650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.66 KB | None | 0 0
  1. # This incomplete apache vhost config will demonstrate how futile domain and ip bans are.
  2. # Remember that this is only one of the many, many, many ways to go around the problem :)
  3. # This should work out of the box if you just enable the following apache mods:
  4. #   rewrite
  5. #   proxy
  6. #   proxy_html
  7. # Just replace yourdomain.com with the domain of your choosing.
  8. # TPB will be accessible from yourdomain.com/main/ (trailing / is needed)
  9.  
  10. <VirtualHost *:80>
  11.  
  12.         <Proxy *>
  13.            Order deny,allow
  14.            Allow from all
  15.         </Proxy>
  16.  
  17. # Change to your domain
  18.         ServerName yourdomain.com
  19.  
  20. # Just to fix a few links...
  21.         RewriteEngine On
  22.         RewriteRule \/main\/\/static\.thepiratebay\.org\/(.*)$ /static/$1 [R=302,L]
  23.  
  24.         ProxyRequests off
  25.  
  26.         ProxyPass /main/ http://thepiratebay.org/
  27.         ProxyPass /static/ http://static.thepiratebay.org/
  28.         ProxyPass /torrents/ http://torrents.thepiratebay.org/
  29.         ProxyHTMLURLMap http://thepiratebay.org /main
  30.         ProxyHTMLURLMap http://([a-z]*).thepiratebay.org /$1 R
  31.  
  32.         <Location /main/>
  33.         ProxyPassReverse /
  34.         SetOutputFilter proxy-html
  35.         ProxyHTMLURLMap / /main/
  36.         RequestHeader unset Accept-Encoding
  37.         </Location>
  38.  
  39.         <Location /static/>
  40.         ProxyPassReverse /
  41.         SetOutputFilter proxy-html
  42.         ProxyHTMLURLMap / /static/
  43.         RequestHeader unset Accept-Encoding
  44.         </Location>
  45.  
  46.         <Location /torrents/>
  47.         ProxyPassReverse /
  48.         SetOutputFilter proxy-html
  49.         ProxyHTMLURLMap / /torrents/
  50.         RequestHeader unset Accept-Encoding
  51.         </Location>
  52.  
  53. </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment