menu
Channels
Chat
view-forward
# All channels
view-forward
# General
view-forward
# Drupal
view-forward
# PHP
view-forward
# Python
view-forward
# Ruby
view-forward
# WordPress
view-forward
Team

HTTPS configuration of Docker4Drupal

December 19, 2019 at 12:11pm

HTTPS configuration of Docker4Drupal

December 19, 2019 at 12:11pm
Project traefik has configured 2 entry points: 80 and 443, defined 2 routers for http and https protocols. Logs show that https request passed to the nginx container successfully, but debugging the php container shows that request received into container downgraded to http request. Does anyone have some recipe or recommendations for proper https configuration?

January 23, 2020 at 7:01pm
Here's what I've set up in docker-compose.yml for apache:
image: wodby/apache:$APACHE_TAG
container_name: "${PROJECT_NAME}_apache"
depends_on:
- php
environment:
APACHE_LOG_LEVEL: debug
APACHE_BACKEND_HOST: php
APACHE_VHOST_PRESET: php
APACHE_DOCUMENT_ROOT: /var/www/html/docroot
volumes:
- ./:/var/www/html
## For macOS users (https://wodby.com/docs/stacks/drupal/local#docker-for-mac)
## - ./:/var/www/html:cached # User-guided caching
## - docker-sync:/var/www/html # Docker-sync
labels:
- "traefik.http.routers.${PROJECT_NAME}_apache.entrypoints=web"
- "traefik.http.routers.${PROJECT_NAME}_apache.rule=Host(`${PROJECT_BASE_URL}`)"
- "traefik.http.middlewares.${PROJECT_NAME}_apache-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.${PROJECT_NAME}_apache.middlewares=${PROJECT_NAME}_apache-https-redirect"
- "traefik.http.routers.${PROJECT_NAME}_https_apache.rule=Host(`${PROJECT_BASE_URL}`)"
- "traefik.http.routers.${PROJECT_NAME}_https_apache.tls=true"
- "traefik.http.routers.${PROJECT_NAME}_https_apache.entrypoints=websecure"
  • reply
  • like
And for traefik: ´´´ traefik: image: traefik:v2.0 container_name: "${PROJECT_NAME}_traefik" command:
- --api.insecure=true
- --providers.docker=true
- --log.level=DEBUG
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --configFile=traefik.toml
ports:
- '443:443'
- '8000:80'
- '8080:8080' # Dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.http.routers.redirs.rule=Host(`${PROJECT_BASE_URL}`)"
- "traefik.http.routers.redirs.entrypoints=web"
- "traefik.http.routers.redirs.entrypoints=websecure"
- "traefik.http.routers.redirs.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
´´´
  • reply
  • like
The problem is that while it redirects part of the content (html for example) the css and js files still come from http. Is this something you are seeing also?
  • reply
  • like