Caddy

基础功能

wget 'https://caddyserver.com/download/linux/amd64?license=personal' -O caddy_base
chmod +x caddy_base
curl https://getcaddy.com | bash -s personal

需要的功能

wget 'https://caddyserver.com/download/linux/amd64?plugins=http.ipfilter&license=personal' -O caddy_hk
chmod +x caddy_hk
curl https://getcaddy.com | bash -s personal http.ipfilter

Caddyfile

cdeyun.com, http://www.cdeyun.com {
    root /srv/cdeyun.com/
}

http://ip.lyl.hk {
	# echo '{{.IP}}' > /srv/ip/index.html
    root /srv/ip/
    templates
}

git.cdeyun.com {
    ipfilter / {
        rule allow
        ip 125.71.132.209 127.0.0.1 172.0.0.0/8 120.77.200.48
    }
    proxy / http://127.0.0.1:10080 {
        header_upstream Host {host}
        header_upstream X-Real-IP {remote}
        header_upstream X-Forwarded-For {remote}
        header_upstream X-Forwarded-Proto {scheme}
    }
}

registry.cdeyun.com {
    proxy / http://127.0.0.1:5000 {
        header_upstream Host {host}
        header_upstream X-Real-IP {remote}
        header_upstream X-Forwarded-For {remote}
        header_upstream X-Forwarded-Proto {scheme}
    }
}

portainer.cdeyun.com {
    ipfilter / {
        rule allow
        ip 125.71.132.209
    }
    proxy / http://127.0.0.1:9000 {
        header_upstream Host {host}
        header_upstream X-Real-IP {remote}
        header_upstream X-Forwarded-For {remote}
        header_upstream X-Forwarded-Proto {scheme}
    }
}