如何在 Forge Laravel 網站上進行 404 錯誤的高級調試 (How to do advanced debugging of 404 Error on Forge Laravel Website)


問題描述

如何在 Forge Laravel 網站上進行 404 錯誤的高級調試 (How to do advanced debugging of 404 Error on Forge Laravel Website)

我最近將以前工作的 PHP Laravel 網站遷移到 DigitalOcean,並正在使用 Forge 管理部署。對於 DNS 託管,我使用的是 AWS Route 53(在那裡購買的域)。

我相信 DNS 有問題,所以我決定確保我仍然可以通過公共 IP 看到該網站. 不幸的是,我似乎只收到 404 錯誤。就像我說的,這個站點之前在 AWS 上使用相同的 Nginx、PHP 和 Laravel 版本運行。

404

所有正確的文件在 /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/*;

關於接下來要調試/研究什麼有什麼想法嗎?我現在只想通過 IP 地址查看我的網絡應用程序。


參考解法

方法 1:

Can you try changing:

listen 80;
listen [::]:80;

To:

listen 80 default_server;
listen [::]:80 default_server;

(by Nick NashTim Rowley)

參考文件

  1. How to do advanced debugging of 404 Error on Forge Laravel Website (CC BY‑SA 2.5/3.0/4.0)

#forge #Laravel #PHP #nginx






相關問題

forge.facebook.authorize 不重定向網站 (forge.facebook.authorize not redirecting for website)

iOS6 和 XCode 4.5 - 無法將應用上傳到應用商店 (iOS6 and XCode 4.5 - Unable to upload app to app store)

trigger.io facebook аўтарызаваць «нечаканы збой» з iphone 5 (trigger.io facebook authorize "unexpected failure" with iphone 5)

Đóng ứng dụng di động Trigger.io forge qua javascript (Android / iOS) - để áp dụng Tải lại (Closing a Trigger.io forge mobile app via javascript (Android / iOS) - in order to apply Reload)

為什麼@inject 方法在實時服務器上不起作用 (why @inject method is not working on the live server)

在 GForge、LDAP 身份驗證中,如何設置屬性 authenticatedBind 的值? (In GForge, LDAP Authentication, how do I set the value for the property authenticatedBind?)

創建一個類對象列表以將它們與另一個類對象進行比較 (creating a list of class objects to compare them with another class object)

Autodesk Forge 如何保存和顯示標記 (Autodesk Forge how to save and show Markups)

如何在 Forge Laravel 網站上進行 404 錯誤的高級調試 (How to do advanced debugging of 404 Error on Forge Laravel Website)

Forge:選擇單個零件:無法在零件之間切換 (Forge: Select a single part: cant switch between parts)

為什麼 composer.json 需要 PHP 7.4 但服務器正在運行 PHP 7.3 不會中斷部署? (Why composer.json requires PHP 7.4 but server is running PHP 7.3 doesn't break in deployment?)

是否可以通過從外部網頁接收特定 ID 來實現 Forge Viewer 中的突出顯示功能? (Is it possible to implement the highlight function in Forge Viewer by receiving a specific ID from an external web page?)







留言討論