Files
docker-stacks/stacks/astro/nginx-cors.conf
knight a4dfbc715f
Some checks failed
Deploy Stacks / deploy-prod (push) Failing after 1s
Deploy Stacks / deploy-dev (push) Has been cancelled
Add astro stack for e.field.ghost.tel
2026-01-24 22:55:12 -05:00

28 lines
1.1 KiB
Plaintext

server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
# CORS configuration
add_header 'Access-Control-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' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
# Handle preflight requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
try_files $uri $uri/ =404;
}
}