Skip to content

Commit 9883604

Browse files
christianWillingChristian WillingJhumanJ
authored
fix local files in docker (#338)
* fix local files in docker Response::make diesnt exist anymore and the nginx.conf didnt allow the needed paths * fix import in api.php --------- Co-authored-by: Christian Willing <cw@c2c-erp.de> Co-authored-by: Julien Nahum <julien@nahum.net>
1 parent 299e1e6 commit 9883604

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

docker/nginx.conf

+10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ server {
2525
try_files $uri $uri/ /index.php$is_args$args;
2626
}
2727

28+
location /local/temp/ {
29+
set $original_uri $uri;
30+
try_files $uri $uri/ /index.php$is_args$args;
31+
}
32+
33+
location /forms/assets/ {
34+
set $original_uri $uri;
35+
try_files $uri $uri/ /index.php$is_args$args;
36+
}
37+
2838
location ~ \.php$ {
2939
fastcgi_split_path_info ^(.+\.php)(/.+)$;
3040
fastcgi_pass unix:/var/run/php-fpm-opnform-site.sock;

routes/api.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use App\Http\Controllers\WorkspaceController;
2121
use App\Http\Middleware\Form\ResolveFormMiddleware;
2222
use Illuminate\Http\Request;
23-
use Illuminate\Http\Response;
2423
use Illuminate\Support\Facades\Route;
2524
use Illuminate\Support\Facades\Storage;
2625

@@ -227,10 +226,8 @@
227226
if (! $request->hasValidSignature()) {
228227
abort(401);
229228
}
230-
$response = Response::make(Storage::get($path), 200);
231-
$response->header('Content-Type', Storage::mimeType($path));
232229

233-
return $response;
230+
return response()->file(Storage::path($path), ['Content-Type' => Storage::mimeType($path)]);
234231
})->where('path', '(.*)')->name('local.temp');
235232

236233
Route::get('caddy/ask-certificate/{secret?}', [\App\Http\Controllers\CaddyController::class, 'ask'])

0 commit comments

Comments
 (0)