-
-
Notifications
You must be signed in to change notification settings - Fork 4k
-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
308 http to https redirect does not work with some ISPs #3722
Comments
Strange. That's unfortunate. You can override the existing redirects by setting up a site block like this:
For next time, please ask your usage questions on the Caddy community forums. We prefer to keep the GitHub issue board for bugs and feature requests. Don't forget to fill out the thread template so we can help you! |
solved my problem |
In case anyone comes across this issue in 2022 or later, the above snippet does not work with newer versions (post 2.4.3 if I'm correct) of Caddy anymore. To get it working you will need to configure
|
I admit, that is a bit confusing 🤔 (It's not obvious why you'd have to disable the auto-redirects when you're manually overriding them anyway.) This might deserve a special note in our docs, @francislavoie -- what do you think? |
Sure, we can make some docs adjustments for this. |
Strange error, but this is a perfect fix. |
I am seeing an issue where some ISPs (9 Mobile in Nigeria for example) do not correctly handle the
308 Permanent Redirect
that Caddy responds with when upgrading an http Request to https. Clients will instead see a blank page sayingService unavailable
and a ISP Logo that got MITMed. Upgrading a request via301 Moved Permanently
works as expected on such connections.This is not really Caddy's fault (9 Mobile also injects ads into everything sent over http and similar), yet it means we can't really use Caddy in such markets as it cuts off everyone from our product that does not provide the https protocol in the URL. I can see the status code for this redirect is hard coded and not configurable here:
caddy/modules/caddyhttp/autohttps.go
Line 324 in 66863aa
Is there any way for us to make Caddy respond with a 301 instead?
The text was updated successfully, but these errors were encountered: