-
-
Save perusio/4404063 to your computer and use it in GitHub Desktop.
A pirate bay proxy configuration for Nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; # IPv4 | |
listen [::]:80 ipv6only=on; # IPv6 | |
server_name ~^(?<thishost>[^.]+\.)?subdomain\.example\.com$; | |
access_log off; | |
location / { | |
## Resolve the upstream address using this DNS server or any other. | |
## Choose the one that suits you. | |
resolver 8.8.8.8; | |
## Apply the substitution filter as many times as necessary. | |
sub_filter_once off; | |
## All references to 'piratebay.se' are to be replaced by our proxy. | |
sub_filter 'thepiratebay.se' 'subdomain.example.com'; | |
## Proxy pass all requests to our upstream. | |
proxy_pass https://${thishost}thepiratebay.se; | |
## We have to disable gzip and other non-identity encodings. Only identity is acceptable. | |
proxy_set_header Accept-Encoding ''; # otherwise content sub fails | |
## No gzipping at all. | |
gzip off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment