search

Home  >  Q&A  >  body text

laravel5.2 quickstart implements local login, registration is using the original Auth, and 404 after uploading

I uploaded it to my local virtual machine (Vbox centos lemp environment)

I use the mac xampp environment to debug quickstart (git), my routing

Route::group(['domain' => 'u.ok.com', 'middleware' => 'web'], function () {

    Route::get('/', function () {
        return view('welcome');//正常显示
    })->middleware('guest');//游客页面
    //以下这几条,主要是登陆在虚拟机浏览都是404
    Route::get('/tasks', 'TaskController@index');
    Route::post('/task', 'TaskController@store');
    Route::delete('/task/{task}', 'TaskController@destroy');
    Route::auth();


});

Route::group(['domain' => 's.ok.com'], function () {
    Route::get('/', 'Test\NewsArr@index');//正常显示
});

Route::group(['domain' => 'a.ok.com'], function () {
    Route::get('/', 'Test\NewsArr@generate');//正常显示
});

I don’t understand the reason for this. The above routes work well on mac, but when uploaded to a virtual machine, the above mentioned 404

will appear.
漂亮男人漂亮男人2846 days ago524

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-05-16 16:54:22

    There is a problem with nginx configuration, please post it and take a look

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 16:54:22

    Nginx configuration (applicable to PHP framework whose route is index.php?routes):

    server
    {
        listen              80;
        server_name         example.com;  #改成你的域名
        root     /var/www/html;  #改成你的document_root
        index    index.php index.html index.htm;
     
        location  /
        {
            try_files $uri $uri/ /index.php?$query_string;  #关键部分
        }
    }

    reply
    0
  • Cancelreply