Apache + SSL PhpMyAdmin

Hi, I’m having problems logging into PhpMyAdmin using the SSL certificate. It shows me a blank login page and when I look at the code inspector it’s because of the connection. And it shows me the following error:

There is a discrepancy between the HTTPS indicated on the server and the client.

I’m using the Let’s Encrypt certificate, do you know if it’s a compatibility issue with the SSL or what I could be doing wrong?

I’ll share my configurations with you:

docker-compose.yml:

services:
  app:
    build:
      context: .
      target: ${APP_ENV}
      dockerfile: Dockerfile
    container_name: qa_app_container
    ports:
      - "${APP_PORT}:80"
    volumes:
      - /qa_app_container:/var/www/html
      - /qa_app_container/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini:rw
    env_file:
      - .env
    networks:
      - qa_network
    depends_on:
      - database

  database:
    image: mariadb:11
    container_name: qa_db_container
    ports:
      - "${EXPOSE_DB_PORT}:3306"
    environment:
      MYSQL_DATABASE: ${DB_DATABASE}
      MYSQL_USER: ${DB_USERNAME}
      MYSQL_PASSWORD: ${DB_PASSWORD}
      MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
    volumes:
      -qa_db_data:/var/lib/mysql
    env_file:
      - .env
    networks:
      - qa_network

  phpmyadmin:
    image: phpmyadmin:5
    container_name: qa_dbAdmin_container
    ports:
      - "${DB_ADMIN_PORT}:80"
    volumes:
      - /qa_app_container:/usr/local/etc/php/conf.d/uploads.ini:rw
      - /qa_app_container/config.inc.php:/var/www/html/config.inc.php
    environment:
      PMA_HOST: database
      PMA_PORT: ${DB_PORT}
      UPLOAD_LIMIT: 1000000000
    env_file:
      - .env
    networks:
      - qa_network

networks:
  qa_network:
    external: true

volumes:
 qa_db_data:
    external: true

.htaccess:

RewriteCond %{HTTP_HOST} ^domain\.com\.mx$
RewriteCond %{SERVER_PORT} ^8202$
RewriteRule ^(.*)$ https://domain.com.mx/$1 [R=301,L]

app.conf

<Proxy *>
   Order deny,allow
   Allow from all
</Proxy>

ProxyPass /phpMyAdmin http://domain.com.mx:8201/
ProxyPassReverse /mariadb http://domain.com.mx:8201/

ProxyPass / http://domain.com.mx:8202/
ProxyPassReverse / http://domain.com.mx:8202/

<Location />
   Order allow,deny
   Allow from all
</Location>

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{domain.com.mx}/$1 [R=301,L]

Thanks for the help.

Please, tell us why you think it is a Docker issue. Unfortunately I see nothing in your post that helps me understand your problem. If the error message is given by PHPMyAdmin, you should try to investigate it from the PHPMyAdmin side. I’m not familiar with the error message you shared, but you can check the cert from the web browser. The icon for it should be next to the URL. Probably on the left side. If you see cert is invalid, it should tell you why.

I also edited your post. Please, read our formatting guide, so you can share code properly next time: How to format your forum posts

Maybe use a reverse proxy with automatic configuration of containers and TLS termination.

Check something like nginx-proxy with companion or simple Traefik example.

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