Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [cors]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

How can i solve this CORS problems?

I've deployed the same backend code node.js (test site and production site) on the same Nginx server and separated it by virtual-host. I've no problem when connecting to a test part. However, when I ...
user avatar
0 votes
0 answers
55 views

content type is returned as text/html while the expected is application/json

some endpoints are returning the content type as text/html while the expected is application/json causing CORS error in the client side. when requesting from my localhost or from the server's IP ...
user avatar
1 vote
0 answers
174 views

OPTIONS request to CloudFront distribution with managed CORS-With-Preflight policy returns 403

I have a CloudFront distribution with a default behavior that is configured to allow any CORS request including preflight requests. However, the OPTIONS request will fail with an HTTP 403 error (...
user avatar
  • 242
1 vote
0 answers
262 views

CloudFront CORS request using signed cookies and withCredentials, not sending back Access-Control-Allow-Credentials unless I include some extra header

I'm having a very strange issue that I can't seem to crack. I configured a private CloudFront distribution to serve content from a private S3 bucket. I am using signed cookies to grant access to the ...
user avatar
  • 61
0 votes
0 answers
26 views

CORS rejection from remote browser access to public web page Ajax call to http://localhost:5000 Nginx reverse proxy, backend server DOTNET 6 KESTREL

Public Domain SSL Certificate signs site and KESTREL backend server (.PEM, now supported in DOTNET 6). Running on Ubuntu 20.04 (Digital Ocean cloud droplet (VM)). Works from CURL and from Browser same-...
user avatar
0 votes
2 answers
377 views

add CORS policy on NGINX server

i'm having difficulties adding CORS policy to my NGINX server. I have pointed DNS server to server but the problem in CORS policy is not working. When accessing subdomain.domain.com everything works ...
user avatar
0 votes
0 answers
134 views

CORS ERROR : "URL scheme "origin" is not supported." to fetch api

A 'CORS' error occurred while transmitting data from the client to the service. Therefore, "Access-Control-Allow-Origin" was added to the 'HTTP response header' to the IIS and to the WCF-Web....
user avatar
  • 1
0 votes
0 answers
29 views

Blocking API requests from unknown "Origins"

I have an API that I'd like to block from unknown origins in production. CORS would work when the API is accessed by a website/browser, but how can I prevent it from being accessed from another ...
user avatar
  • 101
0 votes
0 answers
93 views

Enable CORS-Policy AWS API Gateway "invalid response status code specified"

I'm trying to enable CORS Policy on AWS Apigateway. I have done this before and it worked perfectly. But now, while i copied all the configurations correctly i still cannot enable CORS-Policy. AWS is ...
user avatar
1 vote
0 answers
259 views

CORS is not working NGINX + DJANGO + REACT application

Existing nginx configuration given bellow. I tried in multiple way but nothing is working. server { server_name backend.xxxxxx.com www.backend.xxxxxx.com; client_max_body_size 100M; #...
user avatar
0 votes
0 answers
337 views

Apache Header set missing in server response when php-fpm is active, shown when php-fpm is inactive

Problem: When php-fpm is enabled, cors headers set in .htaccess are not shown in response. When php-fpm is disabled, cors headers are shown in the response. Current setup: Server: Ubuntu 20.04 on ...
user avatar
  • 101
0 votes
0 answers
120 views

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-...
user avatar
0 votes
0 answers
204 views

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 ...
user avatar
0 votes
0 answers
87 views

Angular application CORS issues using Nginx

My Angular application is unable to make requests to my backend. This is the Nginx configuration server { listen 0.0.0.0:443 ssl; listen [::]:443 ssl; server_name my.site.io; ssl_certificate ...
user avatar
0 votes
0 answers
90 views

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:/...
user avatar
  • 1
0 votes
2 answers
1k views

"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 ...
user avatar
0 votes
0 answers
743 views

Nginx Reverse Proxy 403 Errors on POST Requests

I'm trying to set up a stack of services in Docker: Unifi, PHP, Nginx, and Certbot, where Unifi and PHP are the backend services and Nginx serves them in reverse proxy mode, while Certbot runs ...
user avatar
3 votes
1 answer
288 views

Is it impossible to have conditional headers in Nginx?

I am currently trying to only return a set of CORS headers conditionally using Nginx. At first it seemed like a simple task, as I already had this working config: upstream api-app { server unix:/tmp/...
user avatar
0 votes
0 answers
412 views

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 ...
user avatar
  • 1
0 votes
0 answers
596 views

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 ...
user avatar
  • 1
0 votes
1 answer
52 views

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 ...
user avatar
  • 103
1 vote
1 answer
657 views

AWS Cloudfront CORS trouble with font files

I have a Javascript application that is delivered to the browser from a CloudFront endpoint. All static files of the application are hosted in an S3 bucket. That involves a whole bunch of javascript ...
user avatar
  • 207
1 vote
0 answers
99 views

NGINX Cors allow origin not match origin

I have a big problem in my website. Since i moved from Apache webserver to Nginx the ads in my site are not working. I added these lines in my website config file in nginx: add_header 'Access-Control-...
user avatar
  • 11
1 vote
1 answer
127 views

Enable CORS in a specific folder with dot in directory name

I am trying to enable CORS in a specific file (stellar.toml) located at mydomain.com/.well-known/stellar.toml I added the below catch all and allow for testing in my .htaccess file on my litespeed/...
user avatar
0 votes
1 answer
332 views

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....
user avatar
1 vote
0 answers
99 views

Why doesn't CORS apply? in gcp app-engine

I am trying to post marvin JS on the site. There is no problem with the iframe and the function itself, but a problem occurs when using additional functions. When the current page is executed, the ...
user avatar
1 vote
0 answers
331 views

CORS and Preflight problems while making api calls

I have some CORS and preflight problems with my software I can't solve. To test it I was ursing a cors test site to simulate it. When I make an api request to my server application I get the following ...
user avatar
  • 129
0 votes
0 answers
305 views

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. ...
user avatar
  • 173
1 vote
1 answer
670 views

CORS conflict after enabling FPM in PHP

In the .htaccess file on my web server, I have the following CORS header set: Header set Access-Control-Allow-Origin "example.com" In one of my PHP scripts, that I frequently call while ...
user avatar
0 votes
3 answers
525 views

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-...
user avatar
  • 1
1 vote
1 answer
947 views

Nginx - Cross-Origin Request Blocked

We are getting this error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://stats.g.doubleclick.net In our nginx configuration we have: add_header ...
user avatar
  • 479
0 votes
0 answers
1k views

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 ...
user avatar
  • 101
1 vote
1 answer
5k views

Angular CORS with Nginx

Several questions for the same topic on the net but nothing worked. I have a serverXYZ running an Angular app, a backend tomcat webapp for authentication, a nginx server. Angular app on port 4200, ...
user avatar
  • 15
0 votes
3 answers
1k views

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 ...
user avatar
0 votes
1 answer
483 views

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 ...
user avatar
0 votes
0 answers
326 views

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 ...
user avatar
  • 258
2 votes
2 answers
6k views

CORS blocked by No "Access-Control-Allow-Origin" on dockerized Angular frontend app and Spring Boot dockerized backend

I have built an Angular app and created a docker image, which makes it run on an Nginx server (once it is run). For the backend, I have a dockerized implementation as well. While trying to access the ...
user avatar
  • 21
0 votes
1 answer
3k views

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:...
user avatar
1 vote
0 answers
12 views

cors header wasn't set in request although apache server was configured

can anyone point me why my request header wasn't set with cors header although in apache httpd.conf was configured just to do that. Am I missing something here ?? Thanks in advance. <Directory &...
user avatar
1 vote
0 answers
335 views

Nginx Cross-Origin Request Blocked

I have this error in my web page: "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.cdn-example.com. (Reason: CORS header ‘Access-Control-Allow-...
user avatar
  • 23
0 votes
1 answer
480 views

Installing CORS on Ubuntu 18.0.4 LTS

I want to install/use CORS on my Ubuntu server 18.0.4 LTS for the Wordpress websites that I am hosting. Normally I just add the line in the .htaccess but that doesn't seem to work anymore. Any ...
user avatar
1 vote
0 answers
1k views

CORS error despite CORS being enabled in app server and Nginx

I have a web application and server which is fully functional in a debugging environment, however when it's hosted for production, I get the following error in the browser console: Cross-Origin ...
user avatar
  • 111
0 votes
1 answer
204 views

Access-Control-Allow-Origin header is not include in response when using a POST request

I have the following in my nginx config: location / { # CORS add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST' always; proxy_pass ...
user avatar
  • 240
1 vote
0 answers
81 views

Nginx doesn't forward the OPTIONS request to application [duplicate]

I have an Nginx server and a PHP application running in PHP-FPM. The application is restful API. The problem is I get OPTIONS request which the application understands and supports, but the server ...
user avatar
3 votes
0 answers
2k views

firefox throws CORS error but works fine in chrome

I have set the following in apache RequestHeader edit "If-None-Match" '^"((.*)-(gzip|br))"$' '"$1", "$2"' SetEnvIf Origin "^http(s)?:\/\/(.+\.)?(iac-dev-...
user avatar
1 vote
0 answers
291 views

nginx not setting Vary header successfully

I have gzip_vary on; I also have (inside a server section): add_header Vary Origin; Yet when I inspect headers sent, the Vary header only includes Accept-Encoding; if I remove the gzip_vary on; ...
user avatar
  • 2,557
0 votes
0 answers
69 views

How to define CORS settings on root level (base level) in Nginx configuration file

I have this working Nginx configuration: location /static/ { # Uncomment the following line in production mode expires max; # Remove signature of the static files that is used to ...
user avatar
  • 204
1 vote
0 answers
433 views

Should I avoid CORS when building an SPA with backend API hosted on the same server?

I've stumbled upon this question and had the thought that my application should not require CORS, since it is hosted on the same server (a raspberry pi). However, since CORS is a security "feature" I'...
user avatar
  • 21
1 vote
2 answers
1k views

Digital Ocean Spaces S3: Is it possible to add access-control-allow-origin: * to all requests?

If you curl my image curl -i https://local-spaces.fra1.digitaloceanspaces.com/test.jpg you will see that there is no Access-Control-Allow-Origin header in the response. If you curl like this, the ...
user avatar
0 votes
1 answer
3k views

Allow requests only for specific referer within domain

please consider following scenario: I have an API running on the same server as IIS. IIS is hosting a webpage. I want to allow access to the API to this webpage only. No other page from within the ...
user avatar
  • 117