Created
March 13, 2025 08:56
-
-
Save oluceps/7958fe2164099ecb0248eaf0ca83f154 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"admin": { | |
"config": { | |
"persist": false | |
} | |
}, | |
"apps": { | |
"http": { | |
"grace_period": "1s", | |
"servers": { | |
"srv0": { | |
"automatic_https": { | |
"prefer_wildcard": true, | |
"skip_certificates": [] | |
}, | |
"listen": [ | |
":443" | |
], | |
"metrics": {}, | |
"routes": [ | |
{ | |
"handle": [ | |
{ | |
"handler": "subroute", | |
"routes": [ | |
{ | |
"handle": [ | |
{ | |
"handler": "subroute", | |
"routes": [ | |
{ | |
"handle": [ | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "[fdcc::3]:3001" | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"path": [ | |
"/share/*", | |
"/share" | |
] | |
} | |
] | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "authentication", | |
"providers": { | |
"http_basic": { | |
"accounts": [ | |
{ | |
"password": "$2b$05$9CaXvrYtguDwi190/llO9.qytgqCyPp1wqyO0.umxsTEfKkhpwr4q", | |
"username": "immich" | |
} | |
] | |
} | |
} | |
}, | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "[fdcc::3]:2283" | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"photo.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "subroute", | |
"routes": [ | |
{ | |
"handle": [ | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "[fdcc::3]:9000" | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"s3.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "[fdcc::3]:8003" | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"vault.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "rate_limit", | |
"log_key": true, | |
"rate_limits": { | |
"dynamic": { | |
"key": "{http.request.remote.host}", | |
"max_events": 5, | |
"window": "5s" | |
}, | |
"static": { | |
"key": "static", | |
"match": [ | |
{ | |
"method": [ | |
"GET" | |
] | |
} | |
], | |
"max_events": 10, | |
"window": "1m" | |
} | |
} | |
}, | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "localhost:8004" | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"subs.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "reverse_proxy", | |
"headers": { | |
"request": { | |
"set": { | |
"X-Scheme": [ | |
"https" | |
] | |
} | |
} | |
}, | |
"upstreams": [ | |
{ | |
"dial": "[fdcc::3]:8083" | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"book.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "subroute", | |
"routes": [ | |
{ | |
"handle": [ | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "[fdcc::3]:6167" | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"path": [ | |
"/_matrix/*" | |
] | |
} | |
], | |
"terminal": true | |
} | |
] | |
}, | |
{ | |
"handler": "headers", | |
"response": { | |
"set": { | |
"Content-Security-Policy": [ | |
"frame-ancestors 'self'" | |
], | |
"X-Content-Type-Options": [ | |
"nosniff" | |
], | |
"X-Frame-Options": [ | |
"SAMEORIGIN" | |
], | |
"X-XSS-Protection": [ | |
"1; mode=block" | |
] | |
} | |
} | |
}, | |
{ | |
"handler": "file_server", | |
"root": "/nix/store/fvrmjnp9xcb6h825l4xvmil4xdv0cjjf-element-web-wrapped-1.11.91" | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"matrix.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "subroute", | |
"routes": [ | |
{ | |
"handle": [ | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "[fdcc::1]:5000" | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"cache.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "subroute", | |
"routes": [ | |
{ | |
"handle": [ | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "[fdcc::3]:7700" | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"ms.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "rate_limit", | |
"log_key": true, | |
"rate_limits": { | |
"dynamic": { | |
"key": "{http.request.remote.host}", | |
"max_events": 5, | |
"window": "5s" | |
}, | |
"static": { | |
"key": "static", | |
"match": [ | |
{ | |
"method": [ | |
"GET" | |
] | |
} | |
], | |
"max_events": 60, | |
"window": "1m" | |
} | |
} | |
}, | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "127.0.0.1:3999" | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"pb.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "subroute", | |
"routes": [ | |
{ | |
"handle": [ | |
{ | |
"handler": "static_response", | |
"headers": { | |
"Location": [ | |
"https://{http.request.host}{http.request.uri}" | |
] | |
}, | |
"status_code": 302 | |
} | |
], | |
"match": [ | |
{ | |
"method": [ | |
"GET" | |
], | |
"path_regexp": { | |
"pattern": "^/([-_a-z0-9]{0,64}$|docs/|static/)" | |
}, | |
"protocol": "http" | |
} | |
] | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "127.0.0.1:2586" | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"ntfy.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "[fdcc::3]:8084" | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"seed.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"*.nyaw.xyz" | |
] | |
} | |
] | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "[fdcc::3]:8888" | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"api.atuin.nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "subroute", | |
"routes": [ | |
{ | |
"handle": [ | |
{ | |
"handler": "headers", | |
"response": { | |
"set": { | |
"Access-Control-Allow-Origin": [ | |
"*" | |
] | |
} | |
} | |
} | |
], | |
"match": [ | |
{ | |
"path": [ | |
"/.well-known/matrix/*" | |
] | |
} | |
] | |
}, | |
{ | |
"handle": [ | |
{ | |
"body": "{\"m.server\":\"matrix.nyaw.xyz:443\"}", | |
"handler": "static_response" | |
} | |
], | |
"match": [ | |
{ | |
"path": [ | |
"/.well-known/matrix/server" | |
] | |
} | |
] | |
}, | |
{ | |
"handle": [ | |
{ | |
"body": "{\"m.homeserver\":{\"base_url\":\"https://matrix.nyaw.xyz\"},\"m.server\":{\"base_url\":\"https://matrix.nyaw.xyz\"},\"org.matrix.msc3575.proxy\":{\"url\":\"https://matrix.nyaw.xyz\"}}", | |
"handler": "static_response" | |
} | |
], | |
"match": [ | |
{ | |
"path": [ | |
"/.well-known/matrix/client" | |
] | |
} | |
] | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "reverse_proxy", | |
"transport": { | |
"protocol": "http", | |
"tls": { | |
"server_name": "nyaw.xyz" | |
} | |
}, | |
"upstreams": [ | |
{ | |
"dial": "[fdcc::3]:443" | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"nyaw.xyz" | |
] | |
} | |
], | |
"terminal": true | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "authentication", | |
"providers": { | |
"http_basic": { | |
"accounts": [ | |
{ | |
"password": "$2b$05$9CaXvrYtguDwi190/llO9.qytgqCyPp1wqyO0.umxsTEfKkhpwr4q", | |
"username": "prometheus" | |
} | |
] | |
} | |
} | |
}, | |
{ | |
"handler": "metrics" | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"yidhra.nyaw.xyz" | |
], | |
"path": [ | |
"/caddy" | |
] | |
} | |
] | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "authentication", | |
"providers": { | |
"http_basic": { | |
"accounts": [ | |
{ | |
"password": "$2b$05$9CaXvrYtguDwi190/llO9.qytgqCyPp1wqyO0.umxsTEfKkhpwr4q", | |
"username": "prometheus" | |
} | |
] | |
} | |
} | |
}, | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "[::]:9100" | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"yidhra.nyaw.xyz" | |
], | |
"path": [ | |
"/metrics" | |
] | |
} | |
] | |
}, | |
{ | |
"handle": [ | |
{ | |
"handler": "authentication", | |
"providers": { | |
"http_basic": { | |
"accounts": [ | |
{ | |
"password": "$2b$05$9CaXvrYtguDwi190/llO9.qytgqCyPp1wqyO0.umxsTEfKkhpwr4q", | |
"username": "prometheus" | |
} | |
] | |
} | |
} | |
}, | |
{ | |
"handler": "reverse_proxy", | |
"upstreams": [ | |
{ | |
"dial": "[::]:9115" | |
} | |
] | |
} | |
], | |
"match": [ | |
{ | |
"host": [ | |
"yidhra.nyaw.xyz" | |
], | |
"path": [ | |
"/probe" | |
] | |
} | |
] | |
} | |
], | |
"strict_sni_host": false, | |
"tls_connection_policies": [ | |
{ | |
"match": { | |
"sni": [ | |
"*.*.nyaw.xyz", | |
"*.nyaw.xyz", | |
"nyaw.xyz" | |
] | |
}, | |
"protocol_min": "tls1.3" | |
} | |
] | |
} | |
} | |
}, | |
"tls": { | |
"automation": { | |
"policies": [ | |
{ | |
"issuers": [ | |
{ | |
"challenges": { | |
"dns": { | |
"provider": { | |
"api_token": "{env.CF_API_TOKEN}", | |
"name": "cloudflare", | |
"zone_token": "{env.CF_ZONE_TOKEN}" | |
} | |
} | |
}, | |
"module": "acme" | |
} | |
], | |
"subjects": [ | |
"*.nyaw.xyz", | |
"nyaw.xyz" | |
] | |
} | |
] | |
}, | |
"dns": { | |
"api_token": "{env.CF_API_TOKEN}", | |
"name": "cloudflare", | |
"zone_token": "{env.CF_ZONE_TOKEN}" | |
}, | |
"encrypted_client_hello": { | |
"configs": [ | |
{ | |
"public_name": "nyaw.xyz" | |
} | |
] | |
} | |
} | |
}, | |
"logging": { | |
"logs": { | |
"debug": { | |
"level": "debug" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment