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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!