Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 549 Bytes

File metadata and controls

16 lines (12 loc) · 549 Bytes

Return Client IP Address As Plain Text

In Caddy Server, we can use Template(s) to return Client IP Address as plain text, using .RemoteIP, Caddyfile example is given below -

Caddyfile:

example.com {
    templates
    header Content-Type text/plain
    respond "Hello from IPv6, your IPv6 is -> {{.RemoteIP}}"
    encode zstd gzip
}

Source: Caddy Community