Question

ghost is mostly working except for default URL it seems

When I go to my new blog using https://linuxhowto.tech/ it works just fine. When I click on home at the top it works fine.

When I click on the name of the blog and so on it goes to http://localhost:2368/

I can’t see where to change it so URL will always be https://linuxhowto.tech/. I’ve looked through various config files and can’t seem to find what will make this change.

in config.js the url is set to https://linuxhowto.tech just as the instructions call for.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@marmot7

The first thing I would recommend changing is this server block:

server {
    listen 80;
    server_name linuxhowto.tech;
    location / {
         return 301 https://$server_name$request_uri;
    }
}

When it comes to HTTP -> HTTPS redirects, you don’t need to specify a location block. All you need to use is:

server {
    listen 80;
    server_name linuxhowto.tech;

    return 301 https://$server_name$request_uri;
}

Beyond that, I just setup and ran a test installation of Ghost + NGINX using your Proxy Config and it’s working without any issues, so it may be the above that’s causing the issues.

So for you domain, you should have two server blocks that look like:

server {
    listen 80;
    server_name linuxhowto.tech;

    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    server_name linuxhowto.tech;

    ssl on;
    ssl_certificate /etc/letsencrypt/live/linuxhowto.tech/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/linuxhowto.tech/privkey.pem;
    ssl_prefer_server_ciphers On;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;

    location / {
        proxy_pass http://localhost:2368;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;
    }
}

@jtittleI think I marked one of your answers as accepted answer. I really, really appreciate your help. Thank you. It’s been a bit of a long road but I’m happy to say that all is well that ends well. I now have a useable ghost blog that’s https which was my goal for tonight.

I went ahead and restarted the droplet but somehow made the problem change to this:

502 Bad Gateway

LOL. From sort of working to flat out broken.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel