Last active
September 23, 2020 00:16
-
-
Save 0xdade/ccff6bb4aa975183c18e0971846be811 to your computer and use it in GitHub Desktop.
This file contains 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
# A quick nginx config that does some shameless transparent proxying. | |
# The sub_filter module is available on my ubuntu install out of the box, but may not always be available | |
# This demonstration of sub_filter is also extremely minimal. All requests that begin with `/` will load relatively anyways, this attempts to replace any fully qualified requests | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name exploit.party; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name exploit.party; | |
ssl_certificate /etc/letsencrypt/live/exploit.party/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/exploit.party/privkey.pem; | |
location ~ /.well-known { | |
allow all; | |
} | |
location / { | |
proxy_set_header Host mango.pdf.zone; | |
proxy_ssl_server_name on; | |
proxy_set_header REMOTE_ADDR $remote_addr; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_pass https://mango.pdf.zone; | |
sub_filter_once off; | |
sub_filter 'mango.pdf.zone' 'exploit.party'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment