duanbi3786 2018-11-13 04:43
浏览 68

找不到Ubuntu Laravel 404

file config laravel (/etc/nginx/sites-available/laravel)

server {
    listen 97 ;
    listen [::]:97 ;

    root /var/www/TestLaravel/public;
    index index.php index.html index.htm;

    server_name localhost;

    location / {
            try_files $uri $uri/ /index.php?$query_string; 
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass             unix:/var/run/php/php7.3-fpm.sock;
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

file routes web.php

<?php

Route::get('/', function () {
    return view('haha');
});

Route::get('/test', function (){
   return "test";
});

when i run http://ip:97/test or http://ip:97/ result 404 Not Found

I tried the search results internet but could not change anything. I use Php 7.3, Nginx 1.10.3, Laravel 5.7.13. Any suggestions, tutorials or solutions, thanks

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 支付宝批量检测实名工具
    • ¥15 基于单片机的靶位控制系统
    • ¥15 AT89C51控制8位八段数码管显示时钟。
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 下图接收小电路,谁知道原理
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题