server { listen 80; server_name _; root /config/www; index index.html; # CORS configuration for search index location /search/search_index.json { add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always; add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept' always; if ($request_method = 'OPTIONS') { return 204; } } # General CORS for all requests (optional) location / { add_header 'Access-Control-Allow-Origin' '*' always; try_files $uri $uri/ =404; } }