Introduction
After migrating Typecho to a Docker container, enabling HTTPS caused errors when trying to log into the admin panel. It worked fine over HTTP. Since my previous non-Docker deployment didn’t have this issue, I initially suspected a Docker networking problem. At the time, I only needed to make a one-off update, so I just disabled HTTPS, finished the changes, and left it. Now that I’m using Typecho again and need to post regularly, it’s time to fix it properly.
Solution
The fix is straightforward. Add the following line to the end of your data/config.inc.php file:
| |
Then, restart the service.
Root Cause Analysis
According to the reference materials, the issue stems from the interaction between the user, the browser, and the server. While the browser communicates with a proxy (like Cloudflare) via HTTPS, PHP receives an HTTP request from the proxy. PHP then responds using HTTP, which causes the login failure.