1MB file upload works but not 3MB file

I am getting the following error in my browser console when I try to upload a 3MB file to my Cloudflare proxied endpoint:

Access to XMLHttpRequest at 'https://api2.zzz.com/upload_s3' from origin 'XYZ' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Uploads of less than 1MB don’t seem to be a problem. But a 3MB file would trigger the error and disallow the file upload.

I have tried the following below but still no luck:
i) ​double-checked firewall events and do not see events that are blocked
ii) set a page rule for https://api2.zzz.com/upload_s3 to have security disabled

Large file uploads (~3MB) are working when I remove the Cloudflare proxy from the loop, so definitely something to do with Cloudflare here.
Anybody run into this problem or have suggestions?

I would appreciate any suggestions as I am still looking at this problem with no luck. Here is a summary of what I’m trying to do:

enter image description here

I can get my flask app to respond without HTTPS/SSL. But am receiving a ‘503 Service Unavailable’ when I am trying to use SSL. My understanding is since the load balancer has the Cloudflare origin certificate installed, it will SSL terminate so the flask app does not need modifications for SSL.

Here is my Kubernetes yaml for the load balancer and flask app service:

apiVersion: v1
kind: Service
metadata:
  name: flask-service
  labels:
    run: flask-service
  annotations:
    service.beta.kubernetes.io/do-loadbalancer-tls-ports: "443"
    service.beta.kubernetes.io/do-loadbalancer-certificate-id: "68e1d971-1a7c-40d2-8f33-aed797a9535d"        
spec:
  selector:
    app: flask
  ports:
  - name: tcp
    protocol: "TCP"
    port: 5000
    targetPort: 5000
  - name: https
    protocol: TCP
    port: 443
    targetPort: 5000
  type: LoadBalancer
---  
apiVersion: apps/v1
kind: Deployment
metadata:
  name: flask
spec:
  selector:
    matchLabels:
      app: flask  
  replicas: 1
  template:
    metadata:
      labels:
        app: flask
    spec:
      containers:
      - name: flask
        imagePullPolicy: Always
        image: gcr.io/xxxxyyyyyy/flask:staging
        ports:
        - containerPort: 5000
        resources:
          limits:
            memory: 8000Mi
          requests:
            memory: 4000Mi

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.