Error 404 while trying to access Ghost for first time

#1

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: https://docs.ghost.org/setup/

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

0 Likes

#2

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.

0 Likes

#3

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;
}

0 Likes

#4

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

0 Likes

#5

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

0 Likes