Skip to content

Instantly share code, notes, and snippets.

@Appendme
Created August 18, 2026 19:54
Show Gist options
  • Select an option

  • Save Appendme/4f03e91b5ba6a5fca0c2609899e9c9cb to your computer and use it in GitHub Desktop.

Select an option

Save Appendme/4f03e91b5ba6a5fca0c2609899e9c9cb to your computer and use it in GitHub Desktop.
3x-ui caddyfile example with path routing and direct ip https
{
default_sni 123.123.123.123
layer4 {
:443 {
@domains tls {
sni example.com www.example.com
}
route @domains {
proxy 3xui:443
}
route {
proxy localhost:8443
}
}
}
}
123.123.123.123:8443 {
tls {
issuer acme {
profile shortlived
}
}
redir /3xui /3xui/ 301
redir /subs /subs/ 301
handle /subs/* {
reverse_proxy 3xui:2096
}
handle /3xui/* {
reverse_proxy 3xui:2053
}
handle {
error "Not Found" 404
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment