I've had this problem for a long time now. I'm currently on the latest release, 1.7.13. I use nginx as my webserver, and php 7.4.22.
When I log in to the admin interface:
https://www.{website}.com/admin
After entering the username and password, I get redirected to an "http" url at port 443, with the resulting error.
http://www.{website}.com:443/admin
400 Bad Request
The plain HTTP request was sent to HTTPS port
If I click back, in Chrome at least, the browser corrects it and I'm logged in. Last I checked, firefox wouldn't correct it, though.
Everything else in the admin interface and the website seems fine. It's just this during the login that's broken. Nginx redirects http traffic to https, but expects to receive http traffic on port 80.
If I try to set "Force SSL" in the grav settings (with or without the "custom base url" set), I get a redirect error and can no longer access the admin interface. I have to change the config/system.yaml file back manually to access it again.
This page isn’t working
www.{website}.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS
Any idea how I can fix this? Thanks.