From 4ce7c9f85e5479db697c028fa402a244626e6550 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 18 Apr 2025 11:08:06 +0200 Subject: [PATCH] fix(nginx): sintonia conf --- docker/nginx-sintonia.conf.template | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docker/nginx-sintonia.conf.template b/docker/nginx-sintonia.conf.template index 5891db240..b603dadad 100644 --- a/docker/nginx-sintonia.conf.template +++ b/docker/nginx-sintonia.conf.template @@ -1,4 +1,3 @@ - server { listen ${SINTONIA_LARAVEL_PORT}; @@ -14,7 +13,17 @@ server { client_max_body_size 512M; client_body_timeout 300s; + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods "GET, POST, OPTIONS, DELETE, PUT"; + add_header Access-Control-Allow-Headers "Authorization, Content-Type, Accept"; + location / { + if ($request_method = 'OPTIONS') { + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods "GET, POST, OPTIONS, DELETE, PUT"; + add_header Access-Control-Allow-Headers "Authorization, Content-Type, Accept"; + return 204; + } try_files $uri $uri/ /index.php?$query_string; } @@ -28,6 +37,9 @@ server { fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param SERVER_NAME sintonia; include fastcgi_params; + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods "GET, POST, OPTIONS, DELETE, PUT"; + add_header Access-Control-Allow-Headers "Authorization, Content-Type, Accept"; } location ~ /\.(?!well-known).* {