dongmiao4733 2015-10-14 07:33
浏览 136

Laravel 404生产错误

I created a route file with the following structure:

Route::group(['domain' => '46.101.255.245', 'namespace' => 'API'], function() {

    Route::group(['prefix' => 'v1', 'namespace' => 'v1'], function() {

        Route::get('/aeds', 'APIAEDController@index');
    });
});

and a controller containing the method:

public function index() {
    return "OK";
}

When I call the address: 46.101.255.245/v1/aeds

I get a 404. On my local machine the same code runs smoothly. Do I need to change the route file?

The NGINX config:

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

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

        server_name 46.101.255.245;

        location / {
                try_files $uri $uri/ =404;
        }

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /usr/share/nginx/html;
        }

        location ~ \.php$ {
                try_files $uri $uri/ /index.php$is_args$args;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

When I just call the server IP I at least get the routing error which tells me, that laravel is working.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 想问一下stata17中这段代码哪里有问题呀
    • ¥15 flink cdc无法实时同步mysql数据
    • ¥100 有人会搭建GPT-J-6B框架吗?有偿
    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决