add cors rules

This commit is contained in:
F4ilji
2026-01-09 19:07:51 +05:00
parent 596e14feee
commit 1f61601e05
3 changed files with 11 additions and 7 deletions
-1
View File
@@ -21,7 +21,6 @@ server {
root /var/www/public;
location / {
add_header Access-Control-Allow-Origin *; # Заголовок для CORS
try_files $uri /index.php?$args; # Обработка запросов
}
+7 -2
View File
@@ -10,9 +10,14 @@ class TrustProxies extends Middleware
/**
* The trusted proxies for this application.
*
* @var string|array
* @var array|string|null
*/
protected $proxies = '*';
protected $proxies = [
'127.0.0.1',
'10.0.0.0/8',
'172.16.0.0/12',
'192.168.0.0/16',
];
/**
* The headers that should be used to detect proxies.
+4 -4
View File
@@ -2,15 +2,15 @@
return [
'paths' => ['*'],
'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
'allowed_methods' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
'allowed_origins' => ['*'],
'allowed_origins' => [env('APP_URL', 'http://localhost')],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'allowed_headers' => ['Content-Type', 'X-Auth-Token', 'Authorization', 'X-Requested-With'],
'exposed_headers' => [],