Site doesn't redirect correctly after applying certificate

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

Additional info: So I was setting up a subsite and messed smth up, which messed up the encryption on my public site, tried reapliying it, but I accidentally had the same server name in both, that made it redirect to the private sites config, I then fixed it and caused a redirect error, reaplied the certificate, still have the same error, deleted all certbot config parts out of configs and rm * everything in /etc/letsencrypt, tried realiying the certificate and it causes the redirect url. Site runs fine without the certificate.

My domain is: awakening.fun

I ran this command: sudo certbot --nginx

It produced this output: Successfully deployed certificate for awakening.fun to /etc/nginx/sites-enabled/default
Congratulations! You have successfully enabled HTTPS on https://awakening.fun

And Site doesn't redirect correctly in browser.

My web server is (include version): nginx/1.22.1

The operating system my web server runs on is (include version): Debian 12

My hosting provider, if applicable, is: /

I can login to a root shell on my machine (yes or no, or I don't know): Yes.

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): No.

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 3.0.1

Config certbot produced: server { # SSL configuration # # listen 443 ssl default_server; # list - Pastebin.com

Used pastbin, because of formatting here..

You should review your Cloudflare SSL settings.

Somehow you have HTTPS requests going to HTTP. This should never be.

And, your HTTP requests do not redirect to HTTPS and they should.

This is probably best resolved at the Cloudflare community. You might consider using a Cloudflare Origin CA cert too. This is used on your Origin server instead of having to get one from Let's Encrypt. The Cloudflare Origin cert is a one-time process.

This is good place to start on setting up HTTPS with Cloudflare

3 Likes

It worked fine before (I messed it up the first time), I have SSL redirecting off right now and no Let's encrypt things in the config, only serving on port 80.

When I was testing on CF I was switching between SSL redirecting and Off.

The redirecting option that worked before :slight_smile: .

Hello @Dev4fuN,

Using the online tool Let's Debug yields these result, echoing what @MikeMcQ has already stated. https://letsdebug.net/awakening.fun/2318864


CloudflareCDN
Warning
The domain awakening.fun is being served through Cloudflare CDN. Any Let's Encrypt certificate installed on the origin server will only encrypt traffic between the server and Cloudflare. It is strongly recommended that the SSL option 'Full SSL (strict)' be enabled.
https://support.cloudflare.com/hc/en-us/articles/200170416-What-do-the-SSL-options-mean- 

Please see https://support.cloudflare.com/hc/en-us/articles/200170416-What-do-the-SSL-options-mean- from the above warning.

3 Likes

Reinstalled it now after writing the post, it works, everything is the same as I did before, just needed to wait apparently.
Thank you :slight_smile: .