1. My Caddy version (caddy version
):
~ # ./caddy version root@srv
v2.0.0-rc.3 h1:z2H/QnaRscip6aZJxwTbghu3zhC88Vo8l/K57WUce4Q=
2. How I run Caddy:
d. My complete Caddyfile or JSON config:
{
"admin": {
"enforce_origin": false,
"listen": ":2020",
"origins": [
"192.168.10.2:2020"
]
},
"apps": {
"http": {
"servers": {
"srv": {
"automatic_https": {
"skip": [
"dash.swtk.info"
]
},
"listen": [
":443"
],
"routes": [
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "172.18.0.22:8080"
}
]
}
],
"match": [
{
"remote_ip": {
"ranges": [
"192.168.10.0/24",
"192.168.20.0/24"
]
}
}
]
}
]
}
],
"match": [
{
"host": [
"dash.swtk.info"
]
}
],
"terminal": true
}
]
}
}
},
"tls": {
"automation": {
"policies": [
{
"issuer": {
"email": "w@xxx.com",
"module": "acme"
}
}
]
}
}
},
"logging": {
"logs": {
"default": {
"level": "INFO"
}
}
}
}
3. The problem I’m having:
The configuration above is intended to expose http://dash.swtk.info
and not have it redirected to HTTPS (nor have LE certs generated).
It does not work, however: the redirection happens:
# curl http://dash.swtk.info -v root@srv
* Rebuilt URL to: http://dash.swtk.info/
* Trying 192.168.10.2...
* TCP_NODELAY set
* Connected to dash.swtk.info (192.168.10.2) port 80 (#0)
> GET / HTTP/1.1
> Host: dash.swtk.info
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 308 Permanent Redirect
< Connection: close
< Location: https://dash.swtk.info/
< Server: Caddy
< Date: Mon, 04 May 2020 21:05:51 GMT
< Content-Length: 0
<
* Closing connection 0
Is there something I am missing? The JSON configuration above was bootsrapped from
http://dash.swtk.info {
reverse_proxy @lan localhost:8080
@lan {
remote_ip 192.168.10.0/24 192.168.20.0/24
}
}