wordpress上传图片无法显示

原因:

图片出现 mixed blocked (混合内容被拦截),核心原因是:网站已用 HTTPS,但图片 / 资源仍用 HTTP 加载,被浏览器安全策略拦截

因为我是用docker部署的wordpress,所以我需要进入容器内部修改配置文件

bash 复制代码
sudo docker exec -it wordpress /bin/bash
bash 复制代码
apt update && apt install vim
vim wp-config.php

按i 进入insert mode 开始修改配置文件,在add any custom values下面以下添加或修改为以下配置:

bash 复制代码
define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');
 
$_SERVER['HTTPS'] = 'on';
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);
相关推荐
2601_965798474 小时前
Renovate Theme Setup: Fast Contractor & Construction Site Architecture
theme·wordpress
2601_965798472 天前
Salient Theme Setup Guide for Fast Creative WordPress Sites
数据库·web3·php·wordpress
2601_965798474 天前
Boutique Business Consulting WordPress Architecture & SEO Setup
android·theme·wordpress
2601_965798475 天前
Plastic Surgery Clinic Web Setup: Deploying Rejuvita WordPress
php·theme·wordpress
2601_965798475 天前
Contractor Web Setup: Deploying Bathrooms & Kitchens Theme Fast
前端·web3·php·wordpress
e6zzseo12 天前
wordpress独立站seo怎么做才有效
seo·wordpress·独立站·内容优化·外链建设
Web极客码14 天前
如何让用户订阅WordPress评论?提升用户互动的有效策略
运维·服务器·wordpress
fobwebs14 天前
Wordpress Xstore 主题安装Elementor Pro 后找不到某些Elements 组件的解决方法
element·wordpress·form·xstore·pro elements·elementor pro
代龙涛15 天前
WordPress sidebar.php 侧边栏开发教程
开发语言·php·wordpress
代龙涛16 天前
WordPress header.php 与 footer.php 模板结构详解
开发语言·php·wordpress