Setting Ghost URL to https results in redirect to 127.0.0.1

Keywords: Ghost - AWS - Technical issue - Secure Connections (SSL/HTTPS)

bndiagnostic ID: 66321102-4b8d-0ab4-5999-d0df2f77b35f

bndiagnostic output:

? Mariadb: Found possible issues
? Resources: Found possible issues
https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/debug-errors-mariadb/

bndiagnostic failure reason: The tool could not find any issue

Description:
Hello, I am fighting with the setup of https. Despite the generation of the certificate and the apache settings seem to work perfectly, it seems that changing the url field in the config.production.json results in this redirect to localhost. Any idea of the cause?

Hi @ennio.visconti,

Did you check this guide:

https://docs.bitnami.com/aws/apps/ghost/administration/enable-https-ssl-apache/

Regards,
Michiel

Hello, thanks for your help michiel.

I didn’t, because I generated the certificate with the bitnami bncert tool: Auto-configure a Let's Encrypt certificate

Hi @ennio.visconti,

Can you try setting the url in the config.production.json without the https prefix as described in the following guide:

https://docs.bitnami.com/aws/apps/ghost/administration/configure-domain/

"url": "blog.yourdomain.io",

And then restart the Ghost and Apache services?

Best regards,
Michiel

Hello @michiel,

Thanks again!
I tried that already. I re-did it now, and that results in a 503 error and the inability to restart Ghost for a couple of minutes.
It must be noted that Ghost docs requires to have the protocol, and specifically recommends to use https when using SSL (see: Configuration - Adapt your publication to suit your needs)

Hi @ennio.visconti,

Could you try this:

  "url": "http://your.domain.com",
  "server": {
    "port": 2368,
    "host": "0.0.0.0"
  },

Regards,
Michiel

Hello again and thanks @michiel,

As a matter of fact this is the current (and default, AFAIK) settings.
However, this does generate Mixed Content errors, which are the reason why I opened this thread in the first place! I believe that URL flag is used internally by Ghost for some engine-generated URLs, or at least this is coherent with their documentation (that I linked in my previous message), where they explicitly require to use https in that field when using SSL.

You can see the problem live in action at: https://blog.exain.io/

Hi @ennio.visconti,

I’m not seeing any errors checking your website. Regarding the mixed content errors, I recommend asking in the Ghost community forum.

Regards,
Michiel

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