问题:
解决:
mysql8 + caddy1
- 创建数据库
-
|
create database wp111; create user 'bbb' identified with mysql_native_password by 'aaaaa'; grant all on wp111.* to 'bbb'@'%'; |
* with mysql_native_password 是 mysql 8.x 与php 不兼容,低版本可以不需要这个
- docker 启动 wordpress
-
|
docker run --name wordpress1 --restart=on-failure --link mysql:db -e WORDPRESS_DB_HOST='db:3306' -e WORDPRESS_DB_USER='bbb' -e WORDPRESS_DB_PASSWORD='aaaaa' -e WORDPRESS_DB_NAME='wp111' -p 127.0.0.1:1111:80 -d wordpress |
|
UPDATE `wp111`.`wp_options` SET `option_value` = 'https://a.com/' WHERE (`option_id` = '1'); UPDATE `wp111`.`wp_options` SET `option_value` = 'https://a.com/' WHERE (`option_id` = '2'); |
- 配置 caddyfile
|
a.com { gzip proxy / http://127.0.0.1:1111 { header_upstream Host {host} header_upstream X-Real-IP {remote} header_upstream X-Forwarded-For {remote} header_upstream X-Forwarded-Port {server_port} header_upstream X-Forwarded-Proto {scheme} } } |
访问 https://a.com/wp-admin/
参考: