Allow your frontend domain to communicate securely with your API subdomain.
Step-by-Step Instructions
- Add Access-Control-Allow-Origin headers in your API server block.
- Handle OPTIONS preflight requests with HTTP 204.
add_header 'Access-Control-Allow-Origin' 'https://yourdomain.pk' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;Pro Tip: Restrict origins to your exact domain rather than * when sending cookies/credentials.
Need assistance? Open a ticket in the A1 Client Area or contact our 24/7 NOC Engineering Team on WhatsApp at +1 (406) 229-9597.