TYPO3 重定向太多

问题描述 投票:0回答:1

我的环境如下:

Cloudflare (HTTPS) -> AWS ALB (HTTPS) -> AWS EC2 (HTTP) (nginx, php-fpm, typo3)

我正在使用 Cloudflare Full(严格)SSL 模式。

因此存在双重 SSL 终止,一次在 Cloudflare 上,另一次在 AWS 负载均衡器上。 TYPO3 应用程序正在接收 HTTP 上的请求。

我使用的nginx配置来自TYPO3官方文档:

摘录:

...

location / {
    try_files $uri $uri/ /index.php$is_args$args;
}

location = /typo3 {
    rewrite ^ /typo3/;
}

location /typo3/ {
    absolute_redirect off;
    try_files $uri /typo3/index.php$is_args$args;
}

location ~ [^/]\.php(/|$) {
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    if (!-f $document_root$fastcgi_script_name) {
        return 404;
    }
    fastcgi_buffer_size 32k;
    fastcgi_buffers 8 16k;
    fastcgi_connect_timeout 240s;
    fastcgi_read_timeout 240s;
    fastcgi_send_timeout 240s;

    # this is the PHP-FPM upstream - see also: https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/#connecting-nginx-to-php-fpm
    fastcgi_pass         php-fpm:9000;
    fastcgi_index        index.php;
    include              fastcgi.conf;
}

当我访问

https://<MY_DOMAIN>.com/typo3/
时,我收到
ERR_TOO_MANY_REDIRECTS
错误。 我的
index.php
文件夹中的
typo3/
是标准的,没有什么异常的。它应该正在加载 TYPO3 应用程序。

<?php
call_user_func(static function () {
    $classLoader = require dirname(dirname(__DIR__)).'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Backend\Http\Application::class)->run();
});

在我的另一个 TYPO3 网站上,我不使用 Cloudflare + 负载均衡器,SSL 在服务器本身上终止,我没有这个问题。

日志中没有任何内容表明问题可能出在哪里。我什至在 nginx 中启用了调试日志记录。 TYPO3 接收 HTTP 请求。我的假设是 TYPO3 本身正在重定向到 HTTPS,这会导致重定向循环,但我不确定。

php typo3 cloudflare
1个回答
0
投票

TYPO3 中有一个

ForcedHttpsBackendRedirector
中间件,如果
http://
配置选项不是
https://
或零,它会从
lockSSL
重定向到
false
。尝试在 TYPO3
configuration
中将该选项设置为 false

© www.soinside.com 2019 - 2024. All rights reserved.