如何在 Forge Laravel 网站上进行 404 错误的高级调试
How to do advanced debugging of 404 Error on Forge Laravel Website
我最近将以前工作的 PHP Laravel 网站迁移到 DigitalOcean 并使用 Forge 管理部署。对于 DNS 托管,我使用的是 AWS Route 53(在那里购买的域)。
我相信 DNS 出了问题,所以我决定确保我仍然可以通过 public IP 查看该网站。不幸的是,我似乎只收到 404 错误。就像我说的,这个网站以前在 AWS 上使用相同的 Nginx、PHP 和 Laravel 版本。
所有正确的文件都在 /public
目录中,Nginx 没有显示任何编译或状态错误,其配置文件似乎是正确的。
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/dev.agsflagfootballleague.com/before/*;
server {
listen 80;
listen [::]:80;
server_name dev.agsflagfootballleague.com;
server_tokens off;
root /home/forge/dev.agsflagfootballleague.com/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/dev.agsflagfootballleague.com/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/dev.agsflagfootballleague.com-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/dev.agsflagfootballleague.com/after/*;
想 debug/research 接下来做什么?我现在只想通过 IP 地址查看我的网络应用程序。
你可以尝试改变:
listen 80;
listen [::]:80;
收件人:
listen 80 default_server;
listen [::]:80 default_server;
我最近将以前工作的 PHP Laravel 网站迁移到 DigitalOcean 并使用 Forge 管理部署。对于 DNS 托管,我使用的是 AWS Route 53(在那里购买的域)。
我相信 DNS 出了问题,所以我决定确保我仍然可以通过 public IP 查看该网站。不幸的是,我似乎只收到 404 错误。就像我说的,这个网站以前在 AWS 上使用相同的 Nginx、PHP 和 Laravel 版本。
所有正确的文件都在 /public
目录中,Nginx 没有显示任何编译或状态错误,其配置文件似乎是正确的。
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/dev.agsflagfootballleague.com/before/*;
server {
listen 80;
listen [::]:80;
server_name dev.agsflagfootballleague.com;
server_tokens off;
root /home/forge/dev.agsflagfootballleague.com/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/dev.agsflagfootballleague.com/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/dev.agsflagfootballleague.com-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/dev.agsflagfootballleague.com/after/*;
想 debug/research 接下来做什么?我现在只想通过 IP 地址查看我的网络应用程序。
你可以尝试改变:
listen 80;
listen [::]:80;
收件人:
listen 80 default_server;
listen [::]:80 default_server;