OVHcloud Community

Welcome to your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.

Laravel file download not working on OVH, return 403


For some reason, on OVH my Laravel projects not working… and the code is actually pretty simple, just this route:

Route::get(“test”, function(){
$content = “test”;
$headers = [
‘Content-type’ => ‘text/plain’,
‘Content-Disposition’ => sprintf(‘attachment; filename="%s"’, “test.txt”),
‘Content-Length’ => strlen($content)
return \Illuminate\Support\Facades\Response::make($content, 200, $headers);
Then, if I use wget to download this file, I get this:

–2021-11-02 20:26:14-- https:// mywebsite. me/test
Risoluzione di mywebsite. me (mywebsite. me)…
Connessione a mywebsite. me (mywebsite. me)||:443… connesso.
Richiesta HTTP inviata, in attesa di risposta… 403 Forbidden
2021-11-02 20:26:14 ERRORE 403: Forbidden.
If I add a Log::info(“test”) in my web.php the log is empty…

This makes me think that, first of all, is not laravel returning 403, and therefore the server is completely ignoring the .htaccess and going “manually” checking if the file exists, and since there is not that file called test.txt, is returning 403

Are you aware of something like this? How can I solve this?