title: OPTIONS ERR_NAME_NOT_RESOLVED when uploading file to s3
body: <p>I'm trying to upload an image to S3 using Angular and Laravel 5.1. </p>
  
  <p>Angular first asks my server app for a presigned URL, then proceeds to upload the file using the signed request.</p>
  
  <p>I'm getting the following OPTIONS error when the signature returns and then attempts to upload with it:</p>
  
  <p><code>OPTIONS https://s3.us-standard.amazonaws.com/my.resources/dog-aromatherapy.jpg?x-a…Signature=b3ef83... net::ERR_NAME_NOT_RESOLVED</code></p>
  
  <p>my.resources S3 Bucket CORS:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"&gt;
      &lt;CORSRule&gt;
          &lt;AllowedOrigin&gt;*&lt;/AllowedOrigin&gt;
          &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;POST&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;PUT&lt;/AllowedMethod&gt;
          &lt;AllowedHeader&gt;*&lt;/AllowedHeader&gt;
      &lt;/CORSRule&gt;
  &lt;/CORSConfiguration&gt;
  </code></pre>
  
  <p>Laravel:</p>
  
  <pre><code>public function signature(Request $request)
  {
  
      ...get Request filename and filetype...
  
      $s3Client = new S3Client([
          'region'  =&gt; 'us-standard',
          'version' =&gt; 'latest'
      ]);
  
      $options = [
          'Bucket'     =&gt; getenv('AWS_S3_BUCKET'),
          'Key'        =&gt; $file_name,
          'Expires'   =&gt; 60,
          'ContentType' =&gt; $file_type,
          'ACL' =&gt; 'public-read'
      ];
  
      $cmd = $s3Client-&gt;getCommand('PutObject', $options);
  
      $s_request = $s3Client-&gt;createPresignedRequest($cmd, '+20 minutes');
  
      $pre_signedUrl = (string) $s_request-&gt;getUri();
  
      return response()-&gt;json(
          [
              'signed_request' =&gt; $pre_signedUrl,
              'url' =&gt; 'https://s3.amazonaws.com/' . getenv('AWS_S3_BUCKET') . '/' . $file_name
          ]
      );
  }
  </code></pre>
  
  <p><strong>What gives?</strong> I have a valid CORS config on the correct S3 bucket, and am getting a seemingly presigned signature to then allow a file upload... </p>
  
  <hr>
  
  <p>Clicking into the OPTIONS error, headers are as follows:</p>
  
  <pre><code>x-amz-acl:public-read
  X-Amz-Content-Sha256:UNSIGNED-PAYLOAD
  X-Amz-Algorithm:AWS4-HMAC-SHA256
  X-Amz-Credential:AKIA/20160614/us-standard/s3/aws4_request
  X-Amz-Date:20160614T172559Z
  X-Amz-SignedHeaders:host
  X-Amz-Expires:1200
  X-Amz-Signature:b3ef836...
  </code></pre>