caddy-ext icon indicating copy to clipboard operation
caddy-ext copied to clipboard

Error during parsing rate_limit

Open zxiest opened this issue 3 years ago • 1 comments

Hello there,

Any idea why I'm getting the error below?

Error during parsing: parsing caddyfile tokens for 'rate_limit': /etc/caddy/Caddyfile:25 - Error during parsing: Wrong argument count or unexpected line ending after '{http.request.uri.query.id}'

localhost:8080 {
    route /foo {
        rate_limit {query.id} 2r/m

        respond 200
    }
}

This is my Dockerfile

FROM caddy:2.6.2-builder-alpine as builder

RUN xcaddy build \
    --with github.com/RussellLuo/caddy-ext/ratelimit

FROM caddy:2.6.2-alpine

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

and this is my docker-compose.yml

version: "3.7"

services:
  caddy:
    logging:
      options:
        max-size: "500m"
        max-file: "5"

    build: .
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - $PWD/Caddyfile:/etc/caddy/Caddyfile
volumes:
  caddy_data:
  caddy_config:

zxiest avatar Oct 24 '22 15:10 zxiest

Hi @zxiest, has the problem been resolved? (This problem seems weird, and I cannot reproduce it with the above Caddyfile.)

RussellLuo avatar Apr 18 '23 06:04 RussellLuo