From f14c7ccbb36257886266cdff980c122a056ba5fd Mon Sep 17 00:00:00 2001 From: RGBCube Date: Mon, 9 Jun 2025 02:02:36 +0300 Subject: [PATCH] nginx: fix CORS --- modules/nginx.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nginx.nix b/modules/nginx.nix index 493ac76..1fb263f 100644 --- a/modules/nginx.nix +++ b/modules/nginx.nix @@ -64,11 +64,11 @@ in { } map $http_origin $allow_origin { - ~^https://.+\.${domain}$ $http_origin; + ~^https://(?:.+\.)?${domain}$ $http_origin; } map $http_origin $allow_methods { - ~^https://.+\.${domain}$ "CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE"; + ~^https://(?:.+\.)?${domain}$ "CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE"; } ${config.services.nginx.headers}