Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitnami/wordpress Not changing to https after adding WORDPRESS_ENABLE_HTTPS & WORDPRESS_SCHEME #75828

Open
codeace-bot opened this issue Dec 19, 2024 · 0 comments
Assignees
Labels
tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@codeace-bot
Copy link

codeace-bot commented Dec 19, 2024

Name and Version

bitnami/wordpress

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Install Docker by executing the following command in your terminal:

    curl -fsSL https://get.docker.com -o get-docker.sh
    sudo sh get-docker.sh
  2. Create a docker-compose.yml file with the following content:

    # Copyright Broadcom, Inc. All Rights Reserved.
    # SPDX-License-Identifier: APACHE-2.0
    
    services:
      mariadb:
        image: docker.io/bitnami/mariadb:latest
        volumes:
          - 'mariadb_data:/bitnami/mariadb'
        env_file:
          - .env
        environment:
          - MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD} # Ensures root password is set
      wordpress:
        image: docker.io/bitnami/wordpress
        ports:
          - '8080:8080'
          - '8443:8443'
        volumes:
          - 'wordpress_data:/bitnami/wordpress'
        depends_on:
          - mariadb
          - redis
        env_file:
          - .env
        environment:
          - WORDPRESS_PLUGINS=${WORDPRESS_PLUGINS}
      redis:
        image: docker.io/bitnami/redis:latest
        command: ["redis-server", "--bind", "0.0.0.0"]
        volumes:
          - 'redis_data:/bitnami/redis'
        environment:
          - ALLOW_EMPTY_PASSWORD=no # Disable empty passwords for production
    
    volumes:
      mariadb_data:
        driver: local
      wordpress_data:
        driver: local
      redis_data:
        driver: local
  3. .env file

# MariaDB configuration
MARIADB_ROOT_PASSWORD=pass
MARIADB_USER=db
MARIADB_PASSWORD=pass
MARIADB_DATABASE=db

# WordPress configuration
WORDPRESS_DATABASE_HOST=mariadb
WORDPRESS_DATABASE_PORT_NUMBER=3306
WORDPRESS_DATABASE_USER=db
WORDPRESS_DATABASE_PASSWORD=pass
WORDPRESS_DATABASE_NAME=db

# Redis configuration
WORDPRESS_CACHE_HOST=redis
WORDPRESS_CACHE_PORT=6379

# WordPress plugins to install
WORDPRESS_PLUGINS=redis-cache,wp-security-audit-log

# WordPress URLs
WP_SITEURL=https://example.com
WP_HOME=https://example.com
WORDPRESS_ENABLE_HTTPS=yes
WORDPRESS_SCHEME=https

WORDPRESS_AUTO_UPDATE_LEVEL=major
WORDPRESS_ENABLE_REVERSE_PROXY=yes

# Extra WP config content
WORDPRESS_EXTRA_WP_CONFIG_CONTENT=define('WP_REDIS_HOST', 'redis');\ndefine('WP_REDIS_PORT', 6379);\ndefine('WP_REDIS_TIMEOUT', 1);\ndefine('WP_REDIS_READ_TIMEOUT', 1);\ndefine('WP_REDIS_DATABASE', 0);
  1. Install Nginx and create a config
server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://localhost:8080;  # Forward requests to the backend on port 8080
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

    # Handle Cloudflare's IP addresses (Optional: can be included for logging and security purposes)
    set_real_ip_from 103.21.244.0/22;
    set_real_ip_from 103.22.200.0/22;
    set_real_ip_from 103.31.4.0/22;
    set_real_ip_from 104.16.0.0/12;
    set_real_ip_from 108.162.192.0/18;
    set_real_ip_from 131.0.72.0/22;
    set_real_ip_from 141.101.64.0/22;
    set_real_ip_from 162.158.0.0/15;
    set_real_ip_from 172.64.0.0/13;
    set_real_ip_from 173.245.48.0/20;
    set_real_ip_from 188.114.96.0/20;
    set_real_ip_from 190.93.240.0/22;
    set_real_ip_from 197.234.240.0/22;
    set_real_ip_from 198.41.128.0/17;

    real_ip_header X-Forwarded-For;
    real_ip_recursive on;
}

Expected Behavior

WordPress Address (URL) and Site Address (URL) values should be https://example.com.


What Do You See Instead?

Screenshot 2024-12-19 at 11 45 53


Additional Information

No response

@codeace-bot codeace-bot added the tech-issues The user has a technical issue about an application label Dec 19, 2024
@github-actions github-actions bot added the triage Triage is needed label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

2 participants