Skip to content

API fails with reverse proxies that block encoded slashes (%2F) in path #2747

@vincenzomartusciello

Description

@vincenzomartusciello

Versions

  • Pi-hole: v6.3
  • Web: v6.4
  • FTL: v6.4.1

Platform

  • OS and version: Debian 13
  • Platform: Docker

Expected behavior

Toggling lists enabled/disabled state should work when Pi-hole is behind a reverse proxy.

Actual behavior / bug

The Web UI fails with 400 Bad Request when Pi-hole is accessed through Traefik reverse proxy.
The API uses URL-encoded addresses in the path:
PUT /api/lists/https%3A%2F%2Fraw.githubusercontent.com%2FStevenBlack%2Fhosts%2Fmaster%2Fhosts?type=block
Traefik block or decode URL-encoded characters like %2F (slash) and %3A (colon) by default for security reasons.

Works:
Direct access to Pi-hole (no reverse proxy)
After configuring Traefik to allow encoded slashes (allowEncodedSlash: true)

Fails:
Default Traefik configuration (blocks encoded slashes by default)
Any reverse proxy with strict path security settings

More info here: https://doc.traefik.io/traefik/security/request-path/

Steps to reproduce

Steps to reproduce the behavior:

Deploy Pi-hole behind Traefik v3.6+ with default settings
Go to Lists → Blocklists
Click the "Enabled" toggle on any blocklist
See error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions