How to support sharedarraybuffer in fly.toml

i set cross-origin-opener-policy and Cross-Origin-Embedder-Policy in nginx.conf,but when i
deploy to fly.io,the website is not support sharedarraybuffer,what do i miss?

This is a bit late now, not sure if you are still looking into this, but if you are can you open the browser’s network monitor to check that those headers are actually being sent? (Or share the name of the app.)

Those headers should be enough. Maybe your nginx.conf file isn’t being copied into the container; you can start an SSH session using flyctl ssh console to check your file is in the VM (presumably as /etc/nginx/conf.d/default.conf) and has the right content.

thanks for your replay.

  1. my web app is here: https://teddownloader.fly.dev/. this is a free tool to download ted resources.
  2. I check the nginx.conf file on the server, and everything looks good.

The headers are missing on the live site when requesting “/” and “/index.html”, but interestingly they are present when requesting “/test.html”.

I noticed a header fly-cache-status: HIT on “/”. Are you using [[statics]] by any chance? As the docs say, you can’t set headers with that. See also: Removing [statics] from fly.toml has no effect.

You could try to confirm that the issue is with the Fly configuration and not with nginx by starting an SSH session and running wget -O /dev/null -S http://localhost:3000 to view the response headers (probably need to install wget first using apt-get update and apt-get install wget).

2 Likes

thanks for your answer, i removed [[statics]] tags and it works fine!!

From How To to Questions / Help