Questions tagged [cors]
Cross-Origin Resource Sharing (CORS) is a specification that enables open access across domain-boundaries
143
questions
0
votes
0
answers
56
views
How to block API calls outside its own domain ( NGINX )
I have a website running with NGINX where I have an API and a Vue APP, let's say API it's on api.example.com and the Vue APP it's on www.example.com and I have some requests that I can't use a ...
0
votes
1
answer
88
views
S3 site in Cloudfront Preflight 302 Error
I have a static s3 website hosted through CloudFront. In it, I make a request that will result in a redirect if the user is not logged in. Preflight then fails because of a 302:
Access to fetch at '...
0
votes
0
answers
65
views
AWS Elastic Beanstalk max request post size
I have an application consisting of the following:
Vue.JS front-end website
Dotnet Core API
From the front-end, I wish to allow the user to upload up to 10 files totaling up to a maximum of 50 ...
0
votes
0
answers
71
views
NGINX adds header multiple times falsely
I want to add CORS to my reverse-proxy. Generally everything is working but I don't understand why even though reading the documentation on add_header and reading several forum entries.
In my case I ...
0
votes
0
answers
52
views
How does "add_header Access-Control-Allow-Origin * " work
Does it mean our nginx server can access any other server's resources? Or does it mean other any servers can access our nginx server's resources?
I know it's related to Cross Origin Resource Sharing. ...
0
votes
1
answer
543
views
CORS access-control headers not visible in the response headers section of Chrome inspector
Using https://cors-test.codehappy.dev/ to test our test server's new CORS policy, we receive:
These are the response headers received when making the request:
access-control-allow-credentials: true
...
0
votes
0
answers
332
views
Title: CORS Preflight Issue with AWS API Gateway and Lambda Function
I have been experiencing a persistent issue with CORS preflight requests when trying to use AWS API Gateway and Lambda function for sending emails from my website's contact form. Despite following ...
1
vote
1
answer
533
views
Multiple cors sites on Traefik
I'm using Traefik on my Ubuntu server. Cors works fine for one website but when I try to use it for two they seem to conflict. What is the correct syntax?
This is what I have in my docker-compose file:...
0
votes
0
answers
136
views
Apache htaccess denying requests for iOS connections when proper headers are passed
In my the directory for my api, my htaccess file has the following lines:
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "GET, POST, ...
1
vote
0
answers
574
views
How do I fix CORS issues in Cloudfront CDN?
I run a WordPress website and recently configured a CDN using CloudFront.
Most of the features are working fine, but I'm experiencing CORS issues with JS files I'm loading from Github.
I have tried ...
0
votes
1
answer
524
views
Setting up SSL in Apache2 with backend docker app
I'm running Ubuntu server (18.04) on an Azure VM, with Apache2 (2.4.29). I have a backend app running in docker on the same host that is called by my site. This works easy enough without SSL. I added ...
0
votes
1
answer
763
views
NGINX: Return CORS headers when request method is OPTIONS and file exists, otherwise pass to PHP-FPM
I have an NGINX with a PHP-FPM instance behind it. OPTIONS requests for paths for which a file exists in the file system should be handled by NGINX. For those requests, NGINX should return Access-...
0
votes
0
answers
333
views
cors policy blocking request from my docker django nginx app
I am trying to make a POST request from my React app deployed locally to my dockerized Djano app deployed in Google Compute Engine. I am receiving this error:
Access to XMLHttpRequest at 'http://X.X....
0
votes
0
answers
69
views
Multi-Prefix (CORS Header)
How can I make this so it handles both https/http?
add_header Access-Control-Allow-Origin "https://sub.example.com";
What is happening, is specific resources rely on http traffic (//api....
0
votes
0
answers
179
views
Enable CORS via Nginx
I'm having a website (site A) and as it loads a different site (site B) as a part of it. So I added the necessary configuration found here to the nginx configuration of the Site B.
When I load the ...
0
votes
0
answers
1k
views
How to set Access-Control-Allow-Origin for multiple origin domains with Tomcat?
An answer on SO to the same nice - and following guidelines - question but for Apache, how to set Access-Control-Allow-Origin entry header for multiple origin domains deals with .htaccess, checking ...
0
votes
0
answers
95
views
Why would you want a dot at the start of a fqdn in a CORS Access-Control-Allow-Origin header?
I've recently seen a URL listed in a CORS Access-Control-Allow-Origin header where the fqdn portion starts with a dot (eg. 'http://.example.com').
I'm struggling to think of a good reason for this, ...
1
vote
0
answers
158
views
Digital Ocean Space Cors with private files
I am unsure whether I am misunderstanding CORS or whether this is possible within a Digital Ocean Space.
Basically, I want to set a file to private on the DO Space. I only want a certain domain to be ...
1
vote
0
answers
1k
views
Disable CORS using kubernetes ingress
Is it possible to forcefully disable CORS using kubernetes nginx ingress when the application is allowing CORS?
I have an application that I believe is sending Access-Control-Allow-Credentials:true ...
3
votes
2
answers
1k
views
CORS error - Website is not reachable (ERR_FAILED), then redirects and works by itself
Error: I get "This site can't be reached ..." and then it automatically redirects and then the page works. Please see the screengrab GIF below.
This error happens in random unpredictable ...
0
votes
1
answer
2k
views
Getting CORS error while accessing audio files on same server in chrome
Access to video at '/path/to/mp3/file' from origin 'https://example.com' has been blocked by CORS policy: Request had a target IP address space of unknown yet the resource is in address space public.
0
votes
0
answers
681
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 ...
9
votes
2
answers
4k
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 (...
1
vote
0
answers
1k
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 ...
0
votes
2
answers
11k
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 ...
2
votes
0
answers
716
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;
#...
1
vote
0
answers
351
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 ...
0
votes
2
answers
5k
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 ...
1
vote
0
answers
2k
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 ...
5
votes
1
answer
2k
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/...
0
votes
1
answer
2k
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 ...
0
votes
0
answers
1k
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 ...
0
votes
1
answer
583
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 ...
1
vote
1
answer
2k
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 ...
1
vote
0
answers
457
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-...
1
vote
1
answer
446
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/...
0
votes
1
answer
784
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....
1
vote
0
answers
298
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 ...
1
vote
0
answers
1k
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 ...
0
votes
0
answers
847
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. ...
1
vote
1
answer
2k
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 ...
0
votes
3
answers
1k
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-...
1
vote
1
answer
2k
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 ...
0
votes
0
answers
2k
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 ...
2
votes
1
answer
8k
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, ...
0
votes
3
answers
2k
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 ...
1
vote
3
answers
1k
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 ...
0
votes
0
answers
893
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 ...
2
votes
2
answers
9k
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 ...
2
votes
1
answer
10k
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:...