jeudi 22 septembre 2016

Allow Laravel to respond to 403 instead of nginx

I am trying to have Laravel respond a custom 403 error rather than display the default nginx forbidden page.

I have custom handlers for most of my exception types in app/Exceptions/Handler.php and they are working just fine, except for 403. I added the following code to the Handler.php file within the render function to handle 403:

if($e instanceof HttpException && $e->getStatusCode() == 403){
        return response("403 Forbidden error response");
    }

but I still just see the default nginx forbidden page if I lets say navigate to http://ift.tt/2cpfBUb

At this point I am fairly certain this is an nginx config I may be missing, but am not 100% sure what and after searching the web can't seem to find the solution.

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire