- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
设置:
问题
太多的重定向,就像在这些日志中:
Attaching to wp_db, wp, wp_web
wp_db | 2020-01-27 12:13:10+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.11+maria~bionic started.
wp_db | 2020-01-27 12:13:10+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
wp_db | 2020-01-27 12:13:10+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.11+maria~bionic started.
wp | [27-Jan-2020 12:13:10 UTC] PHP Warning: mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 22
wp |
wp | MySQL Connection Error: (2002) Connection refused
wp_db | 2020-01-27 12:13:11 0 [Note] mysqld (mysqld 10.4.11-MariaDB-1:10.4.11+maria~bionic-log) starting as process 1 ...
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Using Linux native AIO
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Uses event mutexes
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Number of pools: 1
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Using SSE2 crc32 instructions
wp_db | 2020-01-27 12:13:11 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Completed initialization of buffer pool
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Creating shared tablespace for temporary tables
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: 10.4.11 started; log sequence number 20529037; transaction id 14604
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
wp_db | 2020-01-27 12:13:11 0 [Note] Plugin 'FEEDBACK' is disabled.
wp_db | 2020-01-27 12:13:11 0 [Note] Server socket created on IP: '::'.
wp_db | 2020-01-27 12:13:11 0 [Note] InnoDB: Buffer pool(s) load completed at 200127 12:13:11
wp_db | 2020-01-27 12:13:11 0 [Warning] 'proxies_priv' entry '@% root@8da7502dc057' ignored in --skip-name-resolve mode.
wp_db | 2020-01-27 12:13:11 0 [Note] Reading of all Master_info entries succeeded
wp_db | 2020-01-27 12:13:11 0 [Note] Added new Master_info '' to hash table
wp_db | 2020-01-27 12:13:11 0 [Note] mysqld: ready for connections.
wp_db | Version: '10.4.11-MariaDB-1:10.4.11+maria~bionic-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
wp | [27-Jan-2020 12:13:13] NOTICE: fpm is running, pid 1
wp | [27-Jan-2020 12:13:13] NOTICE: ready to handle connections
wp | 192.168.48.4 - 27/Jan/2020:12:13:56 +0000 "GET /index.php/wp-admin/install.php" 302
wp_web | 172.28.0.4 - - [27/Jan/2020:12:13:56 +0000] "GET /index.php/wp-admin/install.php HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0" "MYSERVERIP, 162.158.90.139"
wp | 192.168.48.4 - 27/Jan/2020:12:13:56 +0000 "GET /index.php/wp-admin/install.php" 302
wp_web | 172.28.0.4 - - [27/Jan/2020:12:13:56 +0000] "GET /index.php/wp-admin/install.php HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0" "MYSERVERIP, 162.158.90.139"
// here is the loop
配置:
docker-compose.yml
version: '3'
services:
wp_db:
image: mariadb
container_name: wp_db
command: --transaction-isolation=READ-COMMITTED --log-bin=mysqld-bin --binlog-format=ROW
restart: always
volumes:
- ./wp_db:/var/lib/mysql
environment:
- PUID=33
- PGID=33
- MYSQL_PASSWORD=wordpress # needs to be hardcoded
- MYSQL_DATABASE=wordpress # needs to be hardcoded
- MYSQL_USER=wordpress # needs to be hardcoded
- MYSQL_ROOT_PASSWORD=***
networks:
- wordpress
wp:
image: wordpress:php7.4-fpm-alpine
container_name: wp
depends_on:
- wp_db
restart: always
environment:
- PUID=33
- PGID=33
- WORDPRESS_DB_USER=${MYSQL_WORDPRESS_USER}
- WORDPRESS_DB_PASSWORD=${MYSQL_WORDPRESS_PASSWORD}
- WORDPRESS_DB_NAME=${MYSQL_WORDPRESS_DB}
- WORDPRESS_DB_HOST=wp_db
volumes:
- ./wordpress-la:/var/www/html:rw
networks:
- wordpress
wp_web:
build: ./wp_web
container_name: wp_web
restart: always
volumes:
- ./wordpress-la:/var/www/html
- ./wp_web/nginx.conf:/etc/nginx/nginx.conf
environment:
- PUID=33
- PGID=33
- VIRTUAL_HOST=domain.com
- LETSENCRYPT_HOST=domain.com
depends_on:
- wp
networks:
- wordpress
- proxy-tier
networks:
proxy-tier:
wordpress:
nginx.conf
用于 wp_web
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
real_ip_header X-Real-IP;
upstream php {
server wp:9000;
}
server {
server_name domain.com;
root /var/www/html;
index index.php;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_pass php;
proxy_redirect off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
}
nginx 反向代理自动创建它的配置,并将请求转发到 wp_web
(IIRC)。
问题:
如何修复重定向循环?其他一切似乎都有效。我还有其他容器在运行,并且可以通过 domain2.com
访问,没有任何问题。
提前致谢;)
最佳答案
就像@Damocles 所说的那样,必须有
$_SERVER['HTTPS'] = 'on';
在 wp-config.php
中。标准配置
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}
好像还不够。
关于wordpress - 反向代理的重定向太多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59931256/
我能否获得一个具有两个参数的递归Prolog谓词,称为反向,它返回列表的反向: 示例查询和预期结果: α-反向([a,b,c],L)。 L = [c,b,a]。 由两个称为palindrome的参数组
在使用 get_dummies() 将分类数据转换为数字数据后,我的数据框看起来像这样 score1 score2 country_CN country _AU category_leader ca
我有一张 table ,上面有一个国家/地区列表。说这些国家之一是“马其顿” 如果搜索“马其顿共和国”,什么 SQL 查询会返回“马其顿”记录? 我相信在 linq 中它会是这样的 var count
我们有一个角色继承结构,它假设每个人都默认获得最低级别的角色,而不是最高级别的过滤,如下图所示: role.Everyone //lowest level; everyone gets this ro
我正在使用 $.each() 解析数组,但在其中,我使用 .splice() 方法,因此我需要向后迭代。这可能吗? var store = [...]; //... var rules = [...]
我有一个 SPLObjectStorage 对象,其中 Player 对象作为键,分数作为与之关联的信息。玩家对象按照从最高分到最低分的顺序添加到存储中,但我现在需要以相反的顺序遍历它们。 我还需要能
我无法理解这一点:如果我给 Prolog reverse([], A). 它工作得很好,如果我给它 reverse(A, [] ). 并根据第一个建议回答 ; 它挂起!为什么? (GNU Prolog
我有一个 SPLObjectStorage 对象,其中 Player 对象作为键,分数作为与之关联的信息。玩家对象按照从最高分到最低分的顺序添加到存储中,但我现在需要以相反的顺序遍历它们。 我还需要能
我有一个HashMap看起来像: HashMap playerHashMap = new HashMap<>(); 玩家是包含姓名、号码、年龄等的对象。 现在我已经对它进行了排序,它看起来像这样: k
我有这个: file://localhost/Volumes/Untitled%20RAID%20Set%201/Callum/iTunes/Music/Steppenwolf/Steppenwolf
我正在使用 std::regex 并希望找到与某个用户定义的正则表达式字符串匹配的字符串中的最后一个位置。 例如,给定正则表达式 :.* 和字符串“test:55:last”,我想找到“:last”,
有一个表 ServErog(服务),它被重新引导到 4 个表 ServA、ServB、ServC、ServD(它们是不同的非统一服务),其中包含 servtype(服务类型)和 type_id(来自其
这个问题在这里已经有了答案: What is the best way to convert date from JavaScript string in format YYYYMMDD to Ja
我知道如何获得包含几个词的所有结果: SELECT * FROM `table` WHERE MATCH (`row`) AGAINST ('+word1 +word2' IN BOOLEAN MOD
你好,我有这个 html 代码: .container{ width: 450; height: 400; border:1px solid
我想知道是否有任何方法可以使用相同的 CSS 过渡实例来将其向前移动然后向后/向后移动。例如,假设我有这种转变: @-webkit-keyframes fade-transition { fr
假设我有这些字符串: char ref[30] = "1234567891234567891"; char oth[30] = "1234567891234567891"; 我想在 C++ 中使用 S
所以我有这段代码,它使 xcode 崩溃 void strrev(const std::string& str) { for(size_t i=str.length();i>=0;i--)
我正在使用下面的代码使每张图片 1 对 1 淡入淡出。我怎样才能反向执行此操作以使图片以相反的顺序加载? img {display:none;} $('img').each(function(
我正在尝试弄清楚如何改变 FrameLayout 堆叠其子项的方式。 目前它是最新的(先进先出)。我想更改它,使最新的 child 位于底部(FILO)。我试着查看 FrameLayout 的源代码,
我是一名优秀的程序员,十分优秀!