Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

SOLVED! AWS WebGL S3 Bucket Route 53 Domain Anguish

Discussion in 'WebGL' started by GallopingGames, Aug 20, 2021.

  1. GallopingGames

    GallopingGames

    Joined:
    Mar 13, 2013
    Posts:
    26
    Greetings Unity Experts.

    I appear to be stumped at the very last hurdle to get my WebGL build hosted with a Route 53 Domain Name aliased to an S3 Bucket setup as a static website. The direct URL for the Bucket Object index.html works correctly. The WebGL content loads and runs perfectly (so the bucket and object public permissions seem correct and my bucket name matches my domain name as required) Eg.

    https://s3.eu-west-2.amazonaws.com/ my bucket name /index.html

    BUT if I try to visit the same page via my Route 53 registered domain name, the index page loads, but the Unity WebGL content get a red error box warning...

    Unable to load file Build/377f11337da49e35d42cd1361108342b.js.br! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug)

    It seems like the traffic directed through my Route 53 Domain name with alias A type alias Record seems to be screwing up loading / finding the brotli javascript file (and maybe all Unity /Build/ files).

    Can anyone help me out please? I have tried every single forum and blog I can get my hands on, but no luck for days. Many thanks!
     
    Last edited: Aug 20, 2021
  2. GallopingGames

    GallopingGames

    Joined:
    Mar 13, 2013
    Posts:
    26
    SOLVED: I had used Brotli compression which worked on the direct URL because I had divert HTTP requests to HTTPS turned on on the bucket, but when I setup Route 53 Domain name Hosting zone alias it directs traffic on HTTP only. (HTTPS requires a CloudFront setup. CloudFront setup requires SSL Certificate, which requires SES E-Mail setup to confirm the authentication E-Mail to get The Amazon SSL to work. Painful)

    SOLUTION: Brotli compression ONLY WORKS WITH HTTPS requests! I swapped to Gzip compression. Reuploaded, redid the MetaData, Made everything public, and it's all up and running.