1
我嘗試在運行nginx的數字海洋實例上配置我的laravel安裝。Laravel nginx默認文件
默認的配置是這樣的:
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 IPADDRESS;
location/{
try_files $uri $uri/ /index.php$is_args&args =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/mfserver/public;
}
location ~ \.php$ {
try_files $uri $uri/ /index.php$is_args&args =404;
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;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
}
的問題是,當我打電話喜歡/ V1 /抗癲癇藥的路線我得到一個錯誤404處是配置設置不正確?
路線文件:
Route::group(['domain' => 'SERVERIP', 'namespace' => 'API'], function() {
Route::group(['prefix' => 'v1', 'namespace' => 'v1'], function() {
// AED ROUTES
Route::get('/aeds', 'AED\[email protected]');
Route::post('/aeds', 'AED\[email protected]');
Route::get('/aeds/{aeds}', 'AED\[email protected]');
}
不錯..工作!如果我可能問,差異在哪裏? – sesc360
@ sesc360 - 我相信你可能已經工作,如果你在php和$ is_args之間添加問號,但我不確定。記住答案已被其他同樣問題的人接受? – Derek
將在4分鐘內完成:)不允許做;;) – sesc360