diff --git a/main_dc/nginx/nginx-ssl.conf b/main_dc/nginx/nginx-ssl.conf index a4d5232..8d583d8 100644 --- a/main_dc/nginx/nginx-ssl.conf +++ b/main_dc/nginx/nginx-ssl.conf @@ -138,11 +138,13 @@ server { proxy_send_timeout 600; proxy_read_timeout 600; - if ($request_method = OPTIONS) { - return 204; - } - # Handle preflight requests - if ($request_method = OPTIONS) { + if ($request_method = OPTIONS ) { + add_header 'Access-Control-Allow-Origin' "$http_origin"; + add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE'; + add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Length' 0; + add_header 'Content-Type' 'text/plain charset=UTF-8'; return 204; } } diff --git a/main_dc/yalarba/easySite/easySite/nuxt.config.ts b/main_dc/yalarba/easySite/easySite/nuxt.config.ts index a287b5b..073a705 100644 --- a/main_dc/yalarba/easySite/easySite/nuxt.config.ts +++ b/main_dc/yalarba/easySite/easySite/nuxt.config.ts @@ -82,6 +82,8 @@ export default defineNuxtConfig({ '/api': { target: 'https://easysite102.ru', changeOrigin: true, + // Явно указываем перезапись пути + rewrite: (path) => path.replace(/^\/api/, '/api') } } },