Unfortunately, issuing the OPTIONS request yourself is not an option; the JavaScript runtime always generates its own OPTIONS request for security reasons and you have no control over that.  It appears the only solution here is to use namespace BaseURLs.  Note that for testing purposes, you can do all this through your /etc/hosts file, simply add:  namespace.ecs.yourdomain.com     xxx.xxx.xxx.xxx  And configure the BaseURL ecs.yourdomain.com inside ECS.  ECS does not need to verify this hostname with DNS; it simply uses it to parse hosts to differentiate between path-style requests and virtually-hosted requests (i.e. namespace.ecs.yourdomain.com/bucket vs. bucket.namespace.ecs.yourdomain.com).
I am configuring a bucket on a customer's ECS appliance and having an issue with CORS. I have uploaded the configuration via boto and confirmed it was set using the below anonymized code: #!/bin/python  import ssl  from boto.s3.connection import S3Connection from boto.s3.cors import CORSConfiguration  conn = S3Connection(aws_access_key_id=s3_accessKeyId,                 aws_secret_access_key=s3_secretKey,                 host=s3_host,                 port=s3_port,                 calling_format='boto.s3.connection.ProtocolIndependentOrdinaryCallingFormat',                 is_secure=True)  ssl._create_default_https_context = ssl._create_unverified_context  bucket = conn.get_bucket(s3_bucket)  cors_xml = """ 
       
           
   [URL]         
  
   GET
           
  
   PUT
           
  
   POST
           
  
   HEAD
           
  
   Accept-Ranges
           
  
   Content-Range
           
  
   Content-Encoding
           
  
   Content-Length
           
  
   *
         """  bucket.set_cors_xml(cors_xml) print "Current CORS:\n" + bucket.get_cors_xml()  This is the same CORS configuration used on AWS without issue. Below is the output from the script confirming it has been set: $ python script.py Current CORS: 
   
   
    [URL]
    ">
     
      
       GET
      
      
       PUT
      
      
       POST
      
      
       HEAD
      
      
     
    [URL]
    
     
      *
     
     
      Accept-Ranges
     
     
      Content-Range
     
     
      Content-Encoding
     
     
      Content-Length
     
     The "Origin" is being properly set in the request and matches the CORS config. I am using the AWS SDK for Javascript aws-sdk-js/2.2.30. Below are the console errors in the browser: [Error] Failed to load resource: the server responded with a status of 400 (Bad Request) ([s3_bucket], line 0) [Error] Failed to load resource: Origin [URL] is not allowed by Access-Control-Allow-Origin. ([s3_bucket], line 0) [Error] XMLHttpRequest cannot load [URL] Origin [URL] is not allowed by Access-Control-Allow-Origin.  I have even tried setting [URL] with the same result. It's as if the CORS configuration is being ignored? How do I fix this?  The customer is running ECS v2.2.3 on their appliance.
CORS Allowed Origin Issue