Docker

Ellakcy moodle-compose repo:使用了解決方案,但我得到 303 重定向循環

  • July 11, 2018

我使用了ellkcy 的儲存庫提供的 docker -moodle 解決方案,該儲存庫使用了他們建構的 docker images。但由於某種原因,我得到一個 303 重定向循環,並且瀏覽器無法載入 moodle。

在我的.env我已經設置了以下設置

# In case of a reverse proxy please change the following setting
# It should have the url that the USER provides into her/his browser.

MOODLE_URL=https://example.com:8082

# Database configuration
MOODLE_DB_USER=moodle
MOODLE_DB_PASSWORD=somepasswd
MOODLE_DB_NAME=moodle

# Default user
MOODLE_ADMIN=admin
MOODLE_ADMIN_PASSWORD=admin
MOODLE_ADMIN_EMAIL=fakepasswd

# Indicate whether runs Behind SSL Proxy (set values in true  by default are set as false)
MOODLE_REVERSE_LB="true"
MOODLE_SSL="true"

#mail settings
MOODLE_EMAIL_TYPE_QMAIL=false # Set true is qmail MTA a used
MOODLE_EMAIL_HOST=mail.example.com

如您所見,我已經設置了 inMOODLE_REVERSE_LBMOODLE_SSLintotrue值。但似乎不是問題。

正如你提到的:

“但似乎不是問題。”

就是問題所在,因為MOODLE_REVERSE_LB和 的MOODLE_SSL值在引號中,因此配置可能無法將它們辨識為有效的布爾值。

我建議這個連結提到刪除引號,.env應該是:

# In case of a reverse proxy please change the following setting
# It should have the url that the USER provides into her/his browser.

MOODLE_URL=https://example.com:8082

# Database configuration
MOODLE_DB_USER=moodle
MOODLE_DB_PASSWORD=somepasswd
MOODLE_DB_NAME=moodle

# Default user
MOODLE_ADMIN=admin
MOODLE_ADMIN_PASSWORD=admin
MOODLE_ADMIN_EMAIL=fakepasswd

# Indicate whether runs Behind SSL Proxy (set values in true  by default are set as false)
MOODLE_REVERSE_LB=true
MOODLE_SSL=true

#mail settings
MOODLE_EMAIL_TYPE_QMAIL=false # Set true is qmail MTA a used
MOODLE_EMAIL_HOST=mail.example.com

請強調成:

MOODLE_REVERSE_LB=true
MOODLE_SSL=true

如您所見, true未引用。此外,如果對您沒有幫助,您可以嘗試使用該1值,這將導致以下結果.env

# In case of a reverse proxy please change the following setting
# It should have the url that the USER provides into her/his browser.

MOODLE_URL=https://example.com:8082

# Database configuration
MOODLE_DB_USER=moodle
MOODLE_DB_PASSWORD=somepasswd
MOODLE_DB_NAME=moodle

# Default user
MOODLE_ADMIN=admin
MOODLE_ADMIN_PASSWORD=admin
MOODLE_ADMIN_EMAIL=fakepasswd

# Indicate whether runs Behind SSL Proxy (set values in true  by default are set as false)
MOODLE_REVERSE_LB=1
MOODLE_SSL=1

#mail settings
MOODLE_EMAIL_TYPE_QMAIL=false # Set true is qmail MTA a used
MOODLE_EMAIL_HOST=mail.example.com

正如您MOODLE_REVERSE_LBMOODLE_SSL環境變數中看到的那樣,我使用了 value 1

引用自:https://serverfault.com/questions/920471