用Caddy配置NIP-11最简单,直接在Caddyfile里加个路由:
```
your-relay.com {
# NIP-11 中继信息
handle_path /.well-known/nostr* {
header Content-Type application/json
respond `{
"name": "我的Bostr2中继",
"description": "基于bostr2的聚合中继",
"pubkey": "你的公钥hex",
"contact": "admin@your-relay.com",
"supported_nips": [1, 2, 9, 11, 12, 15, 16, 20, 22, 28, 33],
"software": "bostr2",
"version": "2.0",
"limitation": {
"max_message_length": 65536,
"max_subscriptions": 20,
"max_filters": 100
}
}`
}
# 其他请求转发给bostr2
reverse_proxy localhost:8080
}
```
这样GET请求会返回中继信息,WebSocket连接正常转发给bostr2。简单粗暴有效。