Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 01:00 UTC
| 1 | (site) { |
| 2 | https://{args[0]} { |
| 3 | {block} |
| 4 | } |
| 5 | } |
| 6 | |
| 7 | import site test.domain { |
| 8 | reverse_proxy http://192.168.1.1:8080 { |
| 9 | header_up Host {host} |
| 10 | } |
| 11 | } |
| 12 | ---------- |
| 13 | { |
| 14 | "apps": { |
| 15 | "http": { |
| 16 | "servers": { |
| 17 | "srv0": { |
| 18 | "listen": [ |
| 19 | ":443" |
| 20 | ], |
| 21 | "routes": [ |
| 22 | { |
| 23 | "match": [ |
| 24 | { |
| 25 | "host": [ |
| 26 | "test.domain" |
| 27 | ] |
| 28 | } |
| 29 | ], |
| 30 | "handle": [ |
| 31 | { |
| 32 | "handler": "subroute", |
| 33 | "routes": [ |
| 34 | { |
| 35 | "handle": [ |
| 36 | { |
| 37 | "handler": "reverse_proxy", |
| 38 | "headers": { |
| 39 | "request": { |
| 40 | "set": { |
| 41 | "Host": [ |
| 42 | "{http.request.host}" |
| 43 | ] |
| 44 | } |
| 45 | } |
| 46 | }, |
| 47 | "upstreams": [ |
| 48 | { |
| 49 | "dial": "192.168.1.1:8080" |
| 50 | } |
| 51 | ] |
| 52 | } |
| 53 | ] |
| 54 | } |
| 55 | ] |
| 56 | } |
| 57 | ], |
| 58 | "terminal": true |
| 59 | } |
| 60 | ] |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | } |