mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 22:23:48 +03:00
4b1a9b6cc1
* caddy adapt for listen_protocols * adapt listen_socket * allow multiple listen sockets for port ranges and readd socket fd listen logic * readd logic to start servers according to listener protocols * gofmt * adapt caddytest * gosec * fmt and rename listen to listenWithSocket * fmt and rename listen to listenWithSocket * more consistent error msg * non unix listenReusableWithSocketFile * remove unused func * doc comment typo * nonosec * commit * doc comments * more doc comments * comment was misleading, cardinality did not change * addressesWithProtocols * update test * fd/ and fdgram/ * rm addr * actually write... * i guess we doin' "skip": now * wrong var in placeholder * wrong var in placeholder II * update param name in comment * dont save nil file pointers * windows * key -> parsedKey * osx * multiple default_bind with protocols * check for h1 and h2 listener netw
142 lines
2.1 KiB
Text
142 lines
2.1 KiB
Text
{
|
|
auto_https disable_redirects
|
|
admin off
|
|
}
|
|
|
|
http://localhost {
|
|
bind fd/{env.CADDY_HTTP_FD} {
|
|
protocols h1
|
|
}
|
|
log
|
|
respond "Hello, HTTP!"
|
|
}
|
|
|
|
https://localhost {
|
|
bind fd/{env.CADDY_HTTPS_FD} {
|
|
protocols h1 h2
|
|
}
|
|
bind fdgram/{env.CADDY_HTTP3_FD} {
|
|
protocols h3
|
|
}
|
|
log
|
|
respond "Hello, HTTPS!"
|
|
}
|
|
----------
|
|
{
|
|
"admin": {
|
|
"disabled": true
|
|
},
|
|
"apps": {
|
|
"http": {
|
|
"servers": {
|
|
"srv0": {
|
|
"listen": [
|
|
"fd/{env.CADDY_HTTPS_FD}",
|
|
"fdgram/{env.CADDY_HTTP3_FD}"
|
|
],
|
|
"routes": [
|
|
{
|
|
"match": [
|
|
{
|
|
"host": [
|
|
"localhost"
|
|
]
|
|
}
|
|
],
|
|
"handle": [
|
|
{
|
|
"handler": "subroute",
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"body": "Hello, HTTPS!",
|
|
"handler": "static_response"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"terminal": true
|
|
}
|
|
],
|
|
"automatic_https": {
|
|
"disable_redirects": true
|
|
},
|
|
"logs": {
|
|
"logger_names": {
|
|
"localhost": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
"listen_protocols": [
|
|
[
|
|
"h1",
|
|
"h2"
|
|
],
|
|
[
|
|
"h3"
|
|
]
|
|
]
|
|
},
|
|
"srv1": {
|
|
"automatic_https": {
|
|
"disable_redirects": true
|
|
}
|
|
},
|
|
"srv2": {
|
|
"listen": [
|
|
"fd/{env.CADDY_HTTP_FD}"
|
|
],
|
|
"routes": [
|
|
{
|
|
"match": [
|
|
{
|
|
"host": [
|
|
"localhost"
|
|
]
|
|
}
|
|
],
|
|
"handle": [
|
|
{
|
|
"handler": "subroute",
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"body": "Hello, HTTP!",
|
|
"handler": "static_response"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"terminal": true
|
|
}
|
|
],
|
|
"automatic_https": {
|
|
"disable_redirects": true,
|
|
"skip": [
|
|
"localhost"
|
|
]
|
|
},
|
|
"logs": {
|
|
"logger_names": {
|
|
"localhost": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
"listen_protocols": [
|
|
[
|
|
"h1"
|
|
]
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|