Skip to content

Instantly share code, notes, and snippets.

@0xdade
Last active September 23, 2020 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xdade/ccff6bb4aa975183c18e0971846be811 to your computer and use it in GitHub Desktop.
Save 0xdade/ccff6bb4aa975183c18e0971846be811 to your computer and use it in GitHub Desktop.
# 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