Access-Control-Allow-Origin in different environments

Asked

Viewed 261 times

1

I have a very strange problem: the same code works locally and in Prod, but does not work in Homolog.

Basically, the problem is Homolog (logo on login) is this:

Xmlhttprequest cannot load http://xxx. No 'Access-Control-Allow-Origin' header is present on the requested Resource. Origin 'http://xxx' is therefore not allowed access. The Response had HTTP status code 404.

We were with this problem in Prod and we managed to solve, however, when publishing in Homolog, we found this problem again.

In the publication Startup, we allow all origins:

app.UseCors(CorsOptions.AllowAll);

This solved our local and in Prod problem, but still problems in Homolog.

Our front is angled and we don’t touch anything on how the requisitions were made.

  • This should solve the problem, however, check your web.config settings for your approval environment. What version of IIS?

  • According to the AWS dashboard: 64bit Windows Server 2012 R2 v1.2.0 running IIS 8.5. And the configs in Homolog worked a few weeks ago. With no change, it stopped working. We ran a test now by taking the same code that is in Prefod and publishing in Homolog, changing only the web.config and did not solve it. Could be some front server access problem with the api server?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.