我所有注册的路线都在工作。 它们显示视图,但在每个请求上,NotFoundHttpException显示在我的日志文件中。
我正在使用NGINX。 可能是我的NGINXconfiguration?
每个请求中logging的错误(即使视图显示):
log.ERROR: exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /usr/share/nginx/www/example-staging/releases/20130815024541/vendor/laravel/framework/src/Illuminate/Routing/Router.php:1429 Stack trace: #0 /usr/share/nginx/www/example-staging/releases/20130815024541/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1050): Illuminate\Routing\Router->handleRoutingException(Object(Symfony\Component\Routing\Exception\ResourceNotFoundException)) #1 /usr/share/nginx/www/example-staging/releases/20130815024541/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1014): Illuminate\Routing\Router->findRoute(Object(Illuminate\Http\Request)) #2 /usr/share/nginx/www/example-staging/releases/20130815024541/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(530): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #3 /usr/share/nginx/www/example-staging/releases/20130815024541/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(506): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request)) #4 /usr/share/nginx/www/example-staging/releases/20130815024541/content/index.php(49): Illuminate\Foundation\Application->run() #5 {main}
NGINXconfiguration:
# Redirect www. server { listen 80; server_name www.example.com; rewrite ^(.*) http://example.com$1 permanent; } server { listen 80; server_name example.com; access_log /var/log/nginx/example.com/access.log; error_log /var/log/nginx/example.com/error.log; rewrite_log on; root /usr/share/nginx/www/example/current/content; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~* \.php$ { # Server PHP config. fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; # Typical vars in here, nothing interesting. include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } if (!-d $request_filename) { rewrite ^/(.+)/$ /$1 permanent; } location ~ /\.ht { # (deny .htaccess) deny all; } }
这与NGINX配置没有任何关系。
favicon的路径是不正确的。 我认为所有的资源都被找到了,因为在网络检查器中,所有的状态都是OK或者304.我猜测检查器不会在网络标签中显示收藏图标。
正如鲁本斯·马鲁佐(Rubens Mariuzzo)提到的那样,access.log显示favicon为500。
请注意,如果您希望Laravel停止在日志文件中记录404s / Resource Not Found错误,您可以像下面这样编辑您的global.php
文件。
App::error(function(Exception $exception, $code) { // Don't log 404s if ($exception instanceof Symfony\Component\Httpcoreel\Exception\NotFoundHttpException) { return; } Log::error($exception); });