Skip to content

Instantly share code, notes, and snippets.

@jpluscplusm
Forked from anonymous/gist:4366284
Last active December 24, 2019 23:23
Show Gist options
  • Save jpluscplusm/4366287 to your computer and use it in GitHub Desktop.
Save jpluscplusm/4366287 to your computer and use it in GitHub Desktop.
Nginx TPB proxy
server {
listen [::]:80;
listen 80;
server_name "~^(?<thishost>[^.]+.)?(subdomain.example.com)$";
access_log off;
location / {
resolver 8.8.8.8; # or whatever your server can use
sub_filter_once off;
sub_filter 'thepiratebay.se' 'subdomain.example.com';
proxy_pass https://${thishost}thepiratebay.se;
proxy_set_header Accept-Encoding ""; # otherwise content sub fails
gzip off; # otherwise content sub fails
}
}
@DylanIssa2
Copy link

502 gateway error. Works for other hosts like eztv, however. .se is changed to .org. Changing proxy_pass to http:// instead just redirects me to thepiratebay.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment