Invalid operator not_starts_with in Caddy 0.10.3

Caddy version:

caddy --version
Caddy 0.10.3


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: {
  root /var/www/html/
  index index.html
  timeouts 10m
  header / Strict-Transport-Security "max-age=31536000;"
  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}
} {
  redir 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.