对于我的配置,其中论坛无法从 Internet 访问,但可以从我自己的计算机访问),我忽略了警告。
但是,我需要一个域名从我的 Windows 浏览器解析,所以我需要执行以下步骤:
-
通过编辑
c:/windows/system32/drivers/etc/hosts将任意域名(此处为d.com)重定向到我的计算机。我添加了以下行:127.0.0.1 d.com 255.255.255.255 broadcasthost ::1 localhost d.com -
创建一个新文件:
C:\\Users\\yourWindowsUserName\\.wslconfig并在其中写入:[wsl2] localhostForwarding=true -
重启 WSL:
wsl --shutdown(Powershell)
或
wsl.exe --shutdown(Ubuntu) -
在 Ubuntu 中,启动 Docker(它不会自动启动):
service docker start -
注释掉
/var/discourse/container/app.yml中的 SSL 行,例如:# - "templates/web.ssl.template.yml" # - "templates/web.letsencrypt.ssl.template.yml" -
重新构建