modified: main_dc/nginx/nginx-ssl.conf

modified:   main_dc/yalarba/easySite/easySite/nuxt.config.ts
new setting for nginx proxy cors
This commit is contained in:
2025-11-15 05:09:23 +05:00
parent a62c15fb53
commit 39c871476b
2 changed files with 9 additions and 5 deletions
+6 -4
View File
@@ -139,10 +139,12 @@ server {
proxy_read_timeout 600; proxy_read_timeout 600;
if ($request_method = OPTIONS ) { if ($request_method = OPTIONS ) {
return 204; add_header 'Access-Control-Allow-Origin' "$http_origin";
} add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE';
# Handle preflight requests 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';
if ($request_method = OPTIONS) { add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Length' 0;
add_header 'Content-Type' 'text/plain charset=UTF-8';
return 204; return 204;
} }
} }
@@ -82,6 +82,8 @@ export default defineNuxtConfig({
'/api': { '/api': {
target: 'https://easysite102.ru', target: 'https://easysite102.ru',
changeOrigin: true, changeOrigin: true,
// Явно указываем перезапись пути
rewrite: (path) => path.replace(/^\/api/, '/api')
} }
} }
}, },