Invalid operator not_starts_with in Caddy 0.10.3

Caddy version:

caddy --version
Caddy 0.10.3

Issues

2017-06-22 16:56:25,053 INFO spawned: 'caddy' with pid 23
Activating privacy features... done.
2017-06-22 16:56:25,075 INFO exited: caddy (exit status 1; not expected)
2017/06/22 16:56:25 Invalid operator not_starts_with

Caddyfile blow:

example.com:443 {
  root /var/www/html/example.com/
  index index.html
  timeouts 10m
  gzip
  header / Strict-Transport-Security "max-age=31536000;"
  tls example@gmail.com
  rewrite {
    if {file} not favicon.ico
    if {path} not_starts_with /cn
    if {path} not_starts_with /en
    if {>Accept-Language} starts_with zh
    to /cn{uri}
  }
  rewrite {
    if {file} not favicon.ico
    if {path} not_starts_with /cn
    if {path} not_starts_with /en
    to /en{uri}
  }
}

www.example.com:80 example.com:80 www.example.com:443 {
  redir https://example.com 301
}

Ok, after checking with commit history, i found that the problem is in the version.

Yep, for anyone wondering, looks like those docs were updated at the same time as the operator was added to the Caddy source, which hasn’t made it to a release yet. It’ll probably be here in v0.10.4.

I got caught out checking the docs and telling people to use this, too, not realising it wasn’t actually available yet :slight_smile:

I’m sorry that slipped into the website before it was released. I usually cherry-pick website releases when out of band with Caddy releases but I think I must have forgotten to do that this time!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.