Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during parsing rate_limit #13

Open
zxiest opened this issue Oct 24, 2022 · 1 comment
Open

Error during parsing rate_limit #13

zxiest opened this issue Oct 24, 2022 · 1 comment

Comments

@zxiest
Copy link

zxiest commented Oct 24, 2022

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:

@RussellLuo
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants