Skip to content

DW sometimes emits HTTP URL when reverse proxy is HTTPS #38

@schplurtz

Description

@schplurtz

Hi,

I use traefik as reverse proxy. Traefik handles HTTPS, and communicate with DW over HTTP in a classic setup:

         HTTPS              HTTP          
client --------> traefik ----------> DW 

Since this is the first time I use this docker image, I don't know if this is a DW Librarian or docker issue.

Expected behaviour:

Out of the box, DW should always detect HTTPS and only emit HTTPS URL.

observed behavior:

Sometimes DW emits HTTP URL, mainly redirects after form validation:

  • after successfuly filling in the login form
  • after hitting the logout button
  • In extension manager : admin > extension manager > search and install > search for something then hit the install button
    but the search is OK
  • after validating configuration settings
  • after saving page. previewing is OK.

how to reproduce

Install a fresh DokuWiki, run the install script, log in.

I suppose it would be the same with any HTTPS to HTTP reverse proxy.
Here is the docker-compose.yaml file if that matters

services:
  dw:
    image: dokuwiki/dokuwiki:stable
    container_name: dw
    environment:
      - PHP_UPLOADLIMIT=128m
      - PHP_MEMORYLIMIT=512m
      - PHP_TIMEZONE=Europe/Paris
    volumes:
      - ./storage/data/:/storage/
    restart: unless-stopped
    labels:
      - traefik.enable=true
      - traefik.http.routers.dw.rule=Host(`stable-dw.justone.freewww.info`)
      - traefik.http.routers.dw.entrypoints=websecure
      - traefik.http.routers.dw.tls.certresolver=certificatator
      - traefik.http.services.dw.loadbalancer.server.port=8080

Version info

As given by DW in the admin panel.

Release 2025-05-14a "Librarian"
PHP 8.3.21
Debian GNU/Linux 12 (bookworm)
Linux 6.8.0-1024-raspi
apache2handler
Docker

more info

inside the container, the container IP is 10.14.4.2, reverse proxy's IP is 10.14.4.1

I've managed to capture HTTP traffic between reverse proxy and DW. It seems to me traefik sets all the headers an app may want.

Client request : a POST to install a plugin

POST /start?do=admin&page=extension&tab=search&q=a2s HTTP/1.1
Host: stable-dw.justone.freewww.info
User-Agent: ... Firefox/139.0
Content-Length: 65
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Content-Type: application/x-www-form-urlencoded
Cookie: DokuWiki=hidden; DOKU_PREFS=hidden; DWscrambled=hidden
Dnt: 1
Origin: https://stable-dw.justone.freewww.info
Priority: u=0, i
Referer: https://stable-dw.justone.freewww.info/start?do=admin&page=extension&tab=search&q=
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Sec-Gpc: 1
Te: trailers
Upgrade-Insecure-Requests: 1
X-Forwarded-For: 192.168.255.1
X-Forwarded-Host: stable-dw.justone.freewww.info
X-Forwarded-Port: 443
X-Forwarded-Proto: https
X-Forwarded-Server: leela
X-Real-Ip: 192.168.255.1

Server answer, redirect to HTTP

HTTP/1.1 302 Found
Date: Sat, 31 May 2025 06:59:40 GMT
Server: Apache
X-Powered-By: PHP/8.3.21
Vary: Cookie
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: DokuWiki=xxxxx; path=/; HttpOnly; SameSite=Lax
Location: http://stable-dw.justone.freewww.info/start?do=admin&page=extension&tab=search&q=a2s
Content-Length: 0
Content-Type: text/html; charset=UTF-8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions