Unable to access this site

If you’re looking for help, please provide information about your environment. If you delete this template and don’t provide any information, your topic will be automatically closed.

If you aren’t running the latest version of Ghost, the first thing we’ll ask you to do is update to the latest version of Ghost.

And

  • How was Ghost installed and configured?
    Ghost was Installed on hostinger VPS server, and the ghost is running on URL https://156.67.214.45
    but when I try to access the url from the browser getting “This site can’t be reached”
  • What Node version, database, OS & browser are you using?
    Node version: 14.18.1
    Database: mysql
    OS: ubuntu 20.04
  • What errors or information do you see in the console?
    “This site can’t be reached”
  • What steps could someone else take to reproduce the issue you’re having?
    Try to setup ghost on a VPS server and try to access the hosted URL from any system or browser

Please let me know if I need to do any additional configuration in order to access the hosted URL on VPS server from any other system

My config file:
{
“url”: “https://156.67.214.45”,
“server”: {
“port”: 2368,
“host”: “156.67.214.45”
},
“database”: {
“client”: “mysql”,
“connection”: {
“host”: “localhost”,
“user”: “ghost-894”,
“password”: "xxxxxxxxxxxxx,
“database”: “ghost_prod”
}
},
“mail”: {
“transport”: “Direct”
},
“logging”: {
“transports”: [
“file”,
“stdout”
]
},
“process”: “systemd”,
“paths”: {
“contentPath”: “/var/www/ghost/content”
}
}
~

Is it because you are accessing an IP - 156.67.214.45 - via HTTPS which requires a Server certificate to be issued to this IP?

HTTPS is usually used when you are reaching your IP via a domain-name, and the server will have an SSL Certificate proving that it really is that domain.

You could try to set-up / reach your server via HTTP - http://156.67.214.45 - though this is not great on the public internet as your http://156.67.214.45/ghost login credentials will be sent over the network in the clear.

You really need to connect your DNS to your IP and then get a certificate issued to your domain-name.

1 Like

I also note that you have Ghost listening on your public IP… is that really what you want?

Usually you would have nginx listening for HTTP/HTTPS on your public IP and proxy through to a localhost Ghost connection on 127.0.0.1:2368.

You might want to post your nginx config - which is usually in your ./system/files/ site folder. This .conf file shows now nginx is connecting to your Ghost instance.

This is my Ngnix config file content:

server {
listen 80;
listen [::]:80;

server_name 156.67.214.45;
root /var/www/ghost/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)

location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $http_host;
    proxy_pass http://127.0.0.1:2370;

}

location ~ /.well-known {
    allow all;
}

client_max_body_size 50m;

}


when I try to access the url from browser, it is throwing like this

ghost running on vps screenshot

So - you have your NGINX server listening on port 80 - this is HTTP, good (but NOT HTTPS - that is port 443 and needs SSL Certificates)

When a request comes in, NGINX is passing it to 127.0.0.1:2370

This means you have to tell Ghost to listen on 127.0.0.1 and port 2370, so in your config.production.json you need to have:

"server": {
    "port": 2370,
    "host": "127.0.0.1"
},

Note that this is only a partial section of your config.production.json

Hi Jeff,
I already have same thing configured in config.production.json
{
“url”: “http://156.67.214.45”,
“server”: {
“port”: 2370,
“host”: “127.0.0.1”
},
“database”: {
“client”: “mysql”,
“connection”: {
“host”: “localhost”,
“user”: “ghost-485”,
“password”: "xxxxxxxxxxx,
“database”: “xxxx”
}
},
“mail”: {
“transport”: “Direct”
},
“logging”: {
“transports”: [
“file”,
“stdout”
]
},
“process”: “systemd”,
“paths”: {
“contentPath”: “/var/www/ghost/content”
}
}

Hmmm,

TLDR; - don’t set it up using an IP - update your DNS first.

The 404-error page showing is not the default NGINX 404 page, so I guess that you have more configured in NGINX.

In fact if I visit your IP I find a WordPress blog configured - so the issue is that you have other NGINX config that is taking precedence over your Ghost configuration.

To do the job properly, you really should get your DNS updated, and then configure and access your new Ghost blog via a proper domain name - e.g. test.mydomain.com

This is how your users will do it, and then NGINX will know to connect test.mydomain.com to your Ghost blog. It also means you can set up HTTPS immediately so your /ghost/ login will be encrypted while it travels over the public internet.

When you are ready to switch from test.mydomain.com to www.mydomain.com you will just need to make a few changes to your config and get an updated SSL Certificate.