Questions tagged [cors]

Cross-Origin Resource Sharing (CORS) is a specification that enables open access across domain-boundaries

A mechanism to enable client-side cross-origin requests. Specifications that enable an API to make cross-origin requests to resources can use the algorithms defined by this specification. If such an API is used on http://example.org resources, a resource on http://hello-world.example can opt in using the mechanism described by this specification (e.g., specifying Access-Control-Allow-Origin: http://example.org as response header), which would allow that resource to be fetched cross-origin from http://example.org.

http://www.w3.org/TR/cors/

140 questions
0
votes
0 answers

Allow CORS for all subdirectories

Hi, I have this htaccess to allow CORS in my website but seems like it only applies to the root directory Header always set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Headers "origin, x-requested-with, content-type" Header set…
Cain Nuke
  • 77
  • 1
  • 1
  • 3
0
votes
0 answers

CORS and Nginx in front of apache reverse proxy/proxy pass not working to access API server

I'm trying to set up a reverse proxy to my api server but getting a 404 error page. Context: Whilst setting up a react.js application and trying to find a solution to the CORS problem, I've decided to use reverse proxy (proxy pass) with nginx to…
0
votes
0 answers

How to dynamically add CORS sites to Google Cloud App Engine Node API

I am new to API deployment. I have a Node Express API that has CORS enabled in the root app.js, for the API and a socket.io implementation: var app = express(); app.use(cors({ origin : ["http://localhost:8080", "http://localhost:8081"], …
Leon A
  • 1
  • 1
0
votes
2 answers

"CORS Multiple Origin Not Allowed" - using parse-server and apache2

I am using apache2 as a reverse proxy for my parse-server. In order to allow Cross Origin Requests I originally tried setting: Header always set Access-Control-Allow-Origin "*" in the apache config file together with: ProxyPass /parse/…
0
votes
0 answers

Nginx patch request ends up with Invalid CORS request

It's simple set up. Three docker containers in same network. ReactJs - production build on nginx server Spring Boot Mysql GET, POST request works like a charm but when i try to use PATCH request i ends up with Invalid CORS request 2021/09/01…
Lucas
  • 1
  • 2
0
votes
0 answers

how to allow POST to php file in apache only from same-origin?

I have a website with a HTML form that, when submitted, successfully sends a POST request to a .php file on the server (Apache 2.4.48). However, when I let Javascript handle the submitting through a JS fetch(), the server responds with a 405…
Tai
  • 1
  • 2
0
votes
1 answer

CORS prevent js window.onerror from subdomain reporting informations

To log Javascript errors i have set up a function with window.onerror which trigger an ajax request and inform me about script errors. I load all my static files from a subdomain and if an error occurs from a file outside of the main domain, CORS…
delato468
  • 103
  • 4
0
votes
1 answer

FoundryVTT server behind an IIS reverse proxy CORS issues

I have a FoundryVTT server in a FreeNAS jail. I mostly followed these instructions to get it to work. I had a previous problem, which I solved and it works fine now for <= v0.7.9. However, >= v0.8 no longer works and I keep getting CORS related…
Neijwiert
  • 93
  • 1
  • 8
0
votes
0 answers

How to apply access control header to folders AND subfolders in Nginx

In my /etc/nginx/sites-available/default file I currently have blocks along the lines of location /cdn { add_header Access-Control-Allow-Origin *; } which has worked well - up until now. However, I now find myself creating sub directories…
DroidOS
  • 173
  • 7
0
votes
3 answers

CORS won't allow PATCH requests on apache 2.41

I've been trying to use PATCH for an API I'm building. All requests fail because of CORS. I've tried editing my website's .htaccess file to include the following: Header always set Access-Control-Allow-Origin "*" Header always set…
Meaxis
  • 1
0
votes
0 answers

Docker + nginx to bypass CORS

I'd like to use nginx locally to bypass CORS in browser. I'm having trouble with getting the request back out of nginx. How would I get it to call an address back in my own pc's environment/context after getting the request on localhost:5000. My…
Valu3
  • 101
  • 1
0
votes
3 answers

CORS Error in Google App Engine on java server

I have two apps. Frontend(Angular) running on Firebase Backend Spring Boot (Java11) running on App Engine Got this error while trying to reach any endpoints in app engine "Access has been blocked by CORS policy: Response to preflight request doesn't…
0
votes
1 answer

NGINX frontend HTTPS server rejects requests to local backend http express server

I have an application that's split into two servers: one is a React application running on port 8080 and the other is an Express server running on 3001. The machine running this application has to run a few other applications as well, so I set up an…
0
votes
0 answers

Specify header set depending on the HTTP referer

I am working on two separete ReactJS project which are both making use of the PHP API. Both react project are running from the dev server on port 3000 and one on 3001. Because the ReactJS on these ports are going to the API on port 80 its triggering…
Boardy
  • 258
  • 1
  • 4
  • 22
0
votes
1 answer

How to add Access-Control-Allow-Origin header in NGINX for one specific domain

I have problem with my nginx configuration. I want to add Access-Control-Allow-Origin header in nginx config, for one domain but for both http and https I tried this configuration, but it doesn't work: add_header 'Access-Control-Allow-Origin'…
Matix123
  • 1
  • 1
  • 1
1 2 3
9
10