Skip to content

Instantly share code, notes, and snippets.

@zaghaghi
Last active April 30, 2020 11:18
Show Gist options
  • Save zaghaghi/fec628eda1300880df94e9415d086a77 to your computer and use it in GitHub Desktop.
Save zaghaghi/fec628eda1300880df94e9415d086a77 to your computer and use it in GitHub Desktop.

Setup sniproxy [SERVER]

Change DNSs [CLIENT]

  • /etc/hosts (replace x.x.x.x with server ip)
  • or whatever dns solution you like
# /etc/hosts
x.x.x.x docker.com
x.x.x.x www.docker.com
x.x.x.x registry-1.docker.io
x.x.x.x auth.docker.io
x.x.x.x production.cloudflare.docker.com
user nobody
group nogroup
pidfile /var/run/sniproxy.pid
resolver {
# nameserver 127.0.0.1
nameserver 8.8.8.8
mode ipv4_only
}
error_log {
filename /var/log/sniproxy.log
priority notice
}
access_log {
filename /tmp/sniproxy-access.log
}
listen 443 {
proto tls
fallback 127.0.0.1:1443
}
table {
docker\.com$ *:443
.*\.docker\.com$ *:443
.*\.docker\.io$ *:443
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment