Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sreejithvivk's avatar

Error in nginx hosting

I have developed a website and it works perfect in apache hosting. But when i try to host in nginx server, it is giving the below error. "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://auth/login. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)". Request help to resolve this issue.

0 likes
1 reply
fideloper's avatar

A few things to know/checkout:

  1. The CORS error tells us that javascript things it's sending an ajax request to a domain different from what you see in your browser. Check to see if Laravel is creating the correct URL's to use in ajax request, form submissions, etc.
  2. The domain http://auth/login is suspicious - it looks like the domain is just not set at all (is the APP_URL env. variable being used?). I'm guessing that should be something like http://your-site.com/auth/login)

Please or to participate in this conversation.