HTTPS access problem with ClassicPress in Docker

Intro

When accessing my ClassicPress site via HTTPS, it should load correctly without mixed content issues, and the login page (/wp-login.php) should redirect properly to HTTPS and be accessible without errors.

Expected behavior

I should be able to finish the installation of ClassicPress and access the site, including the /wp-login.php page and all other resources, over HTTPS without any errors (from outside my local network).

Current behavior

I deployed ClassicPress using the official Docker image (classicpress/classicpress:latest) on my self-hosted server (ARM64 architecture). The site works fine over HTTP, but there are major issues when trying to access it via HTTPS:

Mixed content issues: On the homepage, CSS (and maybe JavaScript ?) resources are being blocked by the browser because they are loaded via HTTP instead of HTTPS.

On the web admin login page i have this error :
The page isn’t redirecting properly.

These issues persist despite configuring HTTPS in ClassicPress and using Nginx Proxy Manager (NPM) to manage HTTPS with a valid Let’s Encrypt SSL certificate.
The interface in NPM indicates that the site is “online,” and HTTPS is enforced.

My previous blog (using another CMS) was configured on the same server, also via NPM, and worked perfectly with the same wildcard Let’s Encrypt certificate (*.mydomain.xyz). This makes me believe the issue is specific to the ClassicPress setup.

Possible solution

It seems the issue is related to ClassicPress still generating some HTTP URLs internally, either in the database or through other mechanisms. Here are a few possible solutions I thought of but haven’t been able to fully implement or confirm:

  1. Ensure ClassicPress forces all URLs to use HTTPS.
  2. Identify if there is a specific setting in the Docker image that needs to be adjusted for better HTTPS compatibility.
  3. Fix the redirect issues on /wp-login.php.

Any guidance on solving these issues would be greatly appreciated !

Steps to reproduce

version: "3.8"

services:
  classicpress:
    image: classicpress/classicpress:latest
    container_name: classicpress
    depends_on:
      - classicpress_mariadb
    volumes:
      - /data/classicpress/cp_data:/var/www/html
    networks:
      - nginx_proxy_manager_default
    ports:
      - "8780:80"
    environment:
      - WORDPRESS_DB_HOST=classicpress_mariadb
      - WORDPRESS_DB_USER=classicpress_user
      - WORDPRESS_DB_PASSWORD=my_secure_password
      - WORDPRESS_DB_NAME=classicpress_db
    restart: unless-stopped

  classicpress_mariadb:
    image: mariadb:latest
    container_name: classicpress_mariadb
    volumes:
      - /data/classicpress/db_data:/var/lib/mysql
    networks:
      - nginx_proxy_manager_default
    environment:
      - MYSQL_ROOT_PASSWORD=my_root_password
      - MYSQL_DATABASE=classicpress_db
      - MYSQL_USER=classicpress_user
      - MYSQL_PASSWORD=my_secure_password
    restart: unless-stopped

networks:
  nginx_proxy_manager_default:
    external: true

What i’ve tried

  • I’ve checked the port in NPM, in Docker Compose
  • I’ve reinstalled 3 times : same error
  • I’ve edititing wp-config.php: I added the following lines:
define('FORCE_SSL_ADMIN', true);
define('WP_HOME', 'https://blog.nanuq.me');
define('WP_SITEURL', 'https://blog.nanuq.me');
  • I’ve tried to edit the database
UPDATE cp_options SET option_value = REPLACE(option_value, 'http://blog.nanuq.me', 'https://blog.nanuq.me') WHERE option_value LIKE '%http://blog.nanuq.me%';
UPDATE cp_posts SET post_content = REPLACE(post_content, 'http://blog.nanuq.me', 'https://blog.nanuq.me') WHERE post_content LIKE '%http://blog.nanuq.me%';
UPDATE cp_postmeta SET meta_value = REPLACE(meta_value, 'http://blog.nanuq.me', 'https://blog.nanuq.me') WHERE meta_value LIKE '%http://blog.nanuq.me%';

Thank you to take time for help me :slight_smile:

Additional note
I am a student in computer science, so apologies if my explanations are unclear (and by the way, if you’re looking for a developer, I’m available :wink:). I’m still learning and don’t yet have all the technical terminology, so please be patient with me. Thank you!

Pinging @getkoded007 for his input.

let me ask you @OursBlanc, is this local or production server and you need so some kind of container that does let’s encrypt ssl certificates. i don’t really have a tutorial on this, but google should help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.