Caddy 4ip (RemoteIP)

Useful Caddy Tips

Caddy 4ip (RemoteIP)

Caddy respond user RemoteIP with http and https accept Caddyfile:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
http://4ip.tld {
    templates
    header Content-Type text/plain
    respond "{{.RemoteIP}}
"
}

https://4ip.tld {
    tls your@email.com
    templates
    header Content-Type text/plain
    respond "{{.RemoteIP}}
"
}

This config fix newline respond % in zsh

Use:

1
2
$ curl 4ip.tld
62.62.62.62

Example 4ip site http://4ip.su

Licensed under CC BY-NC-SA 4.0