Http to https redirect not working


I’m trying to get http to https redirect working. Currently it is not. This is my Caddyfile. {
        root /var/www/

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: {
        root /var/www/
} {
        root /var/www/

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

Interesting, your first Caddyfile example should be configured correctly.

Are you saying that you can curl 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’.


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