404 on digital ocean, no ssh access. Hi,
I've just done a fresh install of a digital ocean server.
I Added a site, linked to a Github repository.
But when trying to preview the website, by navigating to the IP-address, I'm getting a 404 from Nginx.
When trying to SSH into the server to see what's going on, I'm getting Permission denied (publickey). error. But I've added my public key for the server in Forge.
Thanks in advance,
have you tried to login with "root" ?
If you are creating a server with forge, the ssh user is always "forge" not root.
If you are logged in have a look at the nginx error log at /var/log/nginx/error.log
Oh yes, right, thanks for that username heads-up.
The Nginx error.log file is empty. Same as the site specific error log.
I looked at the Nginx site configuration file, it looks ok.
server {
listen 80;
server_name nwidart.com;
root /home/forge/nwidart.com/public;
# FORGE SSL (DO NOT REMOVE!)
# ssl on;
# ssl_certificate;
# ssl_certificate_key;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/nwidart.com-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_param mysql-password "*******************";
fastcgi_param mysql-username "forge";
fastcgi_param ENV "production";
fastcgi_param mysql-password "*******************";
fastcgi_param mysql-username "forge";
fastcgi_param ENV "production";
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ /\.ht {
deny all;
}
}
Maybe I just can't access it with the IP-address?
Thank you!
Did you enter any Domain Name in forge ?
Just leave it to default ..
Forge does the rest for you.
Because the default directory is "/home/forge/default"
It seems that you entered a Domain Name.
/etc/nginx/sites-available/default
....
root /home/forge/default/public;
....
If you enter the IP the default directory loads the content
Or did you added a DNS A Record for the Domain "nwidart.com" to your Server IP ?
I've added the future domain name yes. But before switching 'nwidart.com' to the new IP I wanted to preview using the IP address.
The A-record is currently in process of switching to the Digital Ocean IP.
Before I deleted the 'default', when I went to the IP, I got the phpinfo information.
I'm guessing I have to change until the DNS propagates.
My advice:
Just delete the forge server and install it new.
Leave the default directory.
Because you dont have to add your domain unless you have serveral sites on your server.
If you point your Domain DNS entry to the IP it`s all fine.
And if the DNS refreshed you can update the nginx config file
Please sign in or create an account to participate in this conversation.