Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

253
Views
Getting CORS errors on AWS EC2 VM, but not in a local test

I wrote some code that takes data from a site, and sends it to me over discord webhook. I had no problems testing the code on my local machine. I then started an AWS VM and uploaded my site to there. I am now Getting CORS errors that look like this.

OPTIONS https://discordapp.com/api/webhooks/             CORS Missing Allow Origin

and

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://discordapp.com/api/webhooks/        (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

What I was able to find on the issue told me to add the "Access-Control-Allow-Origin" header and the "Access-Control-Allow-Methods" header. I added them like so (using javascript with XMLHttpRequest btw).

    xmlhttp.setRequestHeader("Access-Control-Allow-Origin", "*");
    xmlhttp.setRequestHeader("Access-Control-Allow-Methods","*");

Does anyone know a solution to this problem?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!