add cors rules
This commit is contained in:
@@ -21,7 +21,6 @@ server {
|
|||||||
root /var/www/public;
|
root /var/www/public;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
add_header Access-Control-Allow-Origin *; # Заголовок для CORS
|
|
||||||
try_files $uri /index.php?$args; # Обработка запросов
|
try_files $uri /index.php?$args; # Обработка запросов
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,14 @@ class TrustProxies extends Middleware
|
|||||||
/**
|
/**
|
||||||
* The trusted proxies for this application.
|
* 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.
|
* The headers that should be used to detect proxies.
|
||||||
|
|||||||
+4
-4
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
return [
|
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_origins_patterns' => [],
|
||||||
|
|
||||||
'allowed_headers' => ['*'],
|
'allowed_headers' => ['Content-Type', 'X-Auth-Token', 'Authorization', 'X-Requested-With'],
|
||||||
|
|
||||||
'exposed_headers' => [],
|
'exposed_headers' => [],
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user