diff --git a/nginx.conf.sigil b/nginx.conf.sigil index f930d46e..8de054e7 100644 --- a/nginx.conf.sigil +++ b/nginx.conf.sigil @@ -5,7 +5,7 @@ {{ $upstream_port := index $port_map_list 2 }} map $http_origin $allow_origin { - ~^https?:\/\/((.*\.)?localhost(:\d+)?|discoursio-webapp-git(.*)?\.vercel\.app|(.*\.)?discours\.io(:\d+)?)$ $http_origin; + ~^https?:\/\/((.*\.)?localhost(:\d+)?|discoursio-webapp(-(.*))?\.vercel\.app|(.*\.)?discours\.io)$ $http_origin; default ""; } @@ -113,8 +113,8 @@ server { proxy_set_header X-Request-Start $msec; {{ if $.PROXY_X_FORWARDED_SSL }}proxy_set_header X-Forwarded-Ssl {{ $.PROXY_X_FORWARDED_SSL }};{{ end }} - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' $allow_origin always; + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '$allow_origin' always; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; # # Custom headers and headers various browsers *should* be OK with but aren't @@ -131,7 +131,7 @@ server { } if ($request_method = 'POST') { - add_header 'Access-Control-Allow-Origin' $allow_origin always; + add_header 'Access-Control-Allow-Origin' '$allow_origin' always; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always; add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always; @@ -139,7 +139,7 @@ server { } if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' $allow_origin always; + add_header 'Access-Control-Allow-Origin' '$allow_origin' always; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always; add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;