How do i solve a 404 error in my deployment
recently had to delete my server and make a new one. Im using laravel forge btw, i've synced up the repo, imported the last database file. name server is pointing to cloudflare and cloudflare is pointing to linode but somehow i have a 404 error. anything i need to have the site running again?
3 Replies
anything i need to have the site running again?
It could be anything…
Most likely it's a missing asset (like a JS library) or a link that refers someplace that doesn't exist anymore (embedded in your database?).
-- sw
When you sync'd the repo, were the files placed into /var/www/html of your Linode, or another directory?
Is the configuration file appropriately placed in /etc/nginx/conf.d/
, and does it specify the same directory where the site's files are stored in the root root directive?
Without more information, it's as @stevewi said - we can't be sure.
i used forge to set it up. it's a laravel 8 app. Root directory is in /public and the nginx.config seem to point to it.
here is the nginx config.
server {
listen 80;
listen [::]:80;
server_name 172.104.68.38;
server_tokens off;
root /home/forge/default/public;
# FORGE SSL (DO NOT REMOVE!)
# ssl_certificate;
# ssl_certificate_key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS_AES_256_GCM_SHA384:TLS-AES-256-GCM-SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS-CHACHA20-POLY1305-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/dhparams.pem;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/default/server/*;
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/default-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
it also did not show up in the nginx error logs.