Skip to content

Instantly share code, notes, and snippets.

@tairov
Created August 12, 2013 07:34
Show Gist options
  • Save tairov/6208847 to your computer and use it in GitHub Desktop.
Save tairov/6208847 to your computer and use it in GitHub Desktop.
nginx as transparent proxy
(none):~# cat /etc/nginx/sites-enabled/proxy
server {
resolver 8.8.8.8;
access_log off;
listen [::]:8080;
location / {
proxy_pass $scheme://$host$request_uri;
proxy_set_header Host $http_host;
proxy_buffers 256 4k;
proxy_max_temp_file_size 0k;
}
}
iptables -t nat -A PREROUTING -s 10.8.0.0/24 -p tcp --dport 80 -j DNAT --to 192.168.0.253:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment