I used something like this in the past but it’s not nginx.
You can have a look here for a more detailed explanation of the problem and a solution.
For nginx I’m sure there are many tutorials online.
It looks like CORS headers are correctly set on the images served from bubble.
So the problem should be that you miss the crossorigin attribute on the image. How are you loading it?
In javascript you should set the crossorigin attribute before loading the image. Something like:
image = new Image();
image.crossOrigin = "Anonymous";
// set your load listener and then add the src
It’s loaded in “HTML” element. Here the important snippets of the code:
1 <canvas id="canvas"></canvas>
2 <script type="text/javascript">
3 var drawingApp = (function () {
4
5 var canvas,
6 context,
7 ...
8 outlineImage = new Image(),
9 ...
10
11 // Redraws the canvas.
12 redraw = function () {
13 ...
14 // Draw the outline image
15 context.drawImage(outlineImage, drawingAreaX, drawingAreaY, drawingAreaWidth, drawingAreaHeight);
16 },
17
18 // Calls the redraw function after all neccessary resources are loaded.
19 resourceLoaded = function () {
20 redraw();
21 },
22
23 // Creates a canvas element, loads images, adds events, and draws the canvas for the first time.
24 init = function () {
25 canvas = document.getElementById('canvas');
26 canvas.setAttribute('width', canvasWidth);
27 canvas.setAttribute('height', canvasHeight);
28 context = document.getElementById('canvas').getContext("2d");
29
30 // Load images
31 outlineImage.onload = resourceLoaded;
32 outlineImage.src = "https:**Search for ImagesTable:each item's Image**";
33 };
34
35 return {
36 init: init
37 };
38 }());
39 </script>
40 <script type="text/javascript">
41 drawingApp.init();
42 </script>
When I tried to add:
image.crossOrigin = "Anonymous";
before line line #30, I got error:
Access to image at 'https://s3.amazonaws.com/appforest_uf/image.png?auto=compress&fit=max' from origin 'https://my-app.bubbleapps.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.