automatically adding trailing slashes when serving static files from Tigris S3

I’ve used statics to serve static web pages out of Tigris. It works for URLs that end in slash, but ones that don’t fail, and the logs never see them reaching my Nginx server. Am I wrong about how this works? I expected that incoming requests were first handled by Fly directly, based on my [[statics]] setting of tigris_bucket, index_document, etc., and that if there was nothing matching in the bucket, the request would come to my Nginx server. Is that wrong?

My plan is to have Nginx redirect when it receives URLs without trailing slashes, but Nginx has to get control in order to do that.

I’ve just noticed that my app is suspended. It’s serving files, but is suspended, and the machine is stopped. That surprises me because min_machines_running is 1.

Okay, it’s no longer suspended, but I’m not getting anything in the Nginx logs, so my question stands.

Thanks.

If it turns out that it’s not possible to use [[statics]] and still have my web server get HTTP requests that don’t match any files in the Tigris S3 bucket, what’s the best way to deploy a Fly server that does serve files out of Tigris first. Relaying files from Tigris through the server seems like a recipe for slowness.

Added storage, tigris

If the files are in a public Tigris bucket, then you can serve them directly from Tigris: Public Bucket | Tigris Object Storage Documentation

You can also set up a custom domain as mentioned in the docs here if you want to serve the files through your own domain.

Yes, thank you, I’m serving them from a Tigris bucket. But if there is no trailing slash, Tigris is not serving them. For example, if there’s a file about/index.html, and a request for /about comes in, I get an error from Tigris. What’s more, no fallback request reaches Nginx, so I can’t do the redirect myself.

P.S.: But a request for /about/ is served correctly.

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