Http to https redirect not working

Hey,

I’m trying to get http to https redirect working. Currently it is not. This is my Caddyfile.

michaelpope.ml {
        root /var/www/michaelpope.ml
}

What I have tried
-Curling on the VPS works as expected.
-Using Chrome on my home computer does not redirect (either normally or with the cache not saved in developer options).
-I also tried removing the redirect and instead just serving the files directly via http, which results in the same problems, that is that curl works but the browse does not. It looks like this:

https://michaelpope.ml {
        root /var/www/michaelpope.ml
}
http://michaelpope.ml {
        root /var/www/michaelpope.ml
}

Does anybody have any experiences about why this might not be working?
Thanks!
-Michael Pope

Interesting, your first Caddyfile example should be configured correctly.

Are you saying that you can curl https://michaelpope.ml but browsing there in Chrome gives you some kind of error?

1 Like

Sorry about responding so late, I had church, then work, then etc… just got very busy =).

I found out what the problem was. And I feel kinda sad about it. I forgot to allow 80/tcp through ufw.

Thanks for your help though!

And to clarify what I saw, I could curl it on the remote machine, but when viewing it on Chrome on my regular computer, I couldn’t reach it. Https worked, but http did not. And then on thinking about it, I was like ‘oh duh, the firewall’.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.