Error 404 while trying to access Ghost for first time

Hello,

I have a ubuntu 18 Virtual Machine on AWS and DB on AWS RDS.
I am trying to install Ghost on this machine. I successfully followed all the steps mentioned in this site: How to install Ghost, the official guide

The steps were successful and it also gave me a url to access and setup Ghost. But whenever I try to access ghost using that url, it always Throws Error 404.

Thanks
Dharmil

I think your nginx setting is not complete.

Go to the ghost project directory and setup nginx again with the following commands.

cd /var/www/ghost
ghost setup nginx

Enter url without port when asked.

Hello Fred,

Thanks for replying. I tried to run the command you said.
But it skipped nginx configuration

i Also ran : ghost doctor

The following is the result, for ghost doctor and setup nginx

My ghost config file :

/var/www/ghost/system/files/example.conf

server {
listen 80;
listen [::]:80;
server_name example.com;
root /var/www/ghost/system/nginx-root;
location ^~ /learn/ {
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:2368;
proxy_redirect off;
}
location ~ /.well-known {
allow all;
}
client_max_body_size 50m;
}

Hi there,

Run this for the ghost instance status in the ghost root directory.

ghost status

Show these results also.

ghost log
sudo netstat -tulpen
systemctl status nginx

Just to confirm that you are using example.com not to public your dns name here , right?
You have to use your actual public IP or public DNS from aws instance for the URL.
You have to open the HTTP port (80) in the Inbound Rules of your security group for the virtual machine in aws also.

Best Regards,
Fred

Hello Fred,

Many thanks for your response.I finally found a solution.

I stumbled upon this amazing article which explains running ghost on Apache and in minutes my ghost blog was up.

On nginx, I was not able to get it running.

Best,
Dharmil

1 Like

Great, but IMHO, it is much easier to use nginx. :slight_smile:

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