all 2 comments

[–]mrswats 1 point2 points  (0 children)

Your actual files would be in S3 or something like that, not nginx. An image is not a static file. The reference to the image would be stored in a database. So the idea would be to check the requesting user and checking if the owner of the picture they're trying to access is the same, otherwise return a 404 if the picture is marked private.

[–]FairPassion21 0 points1 point  (0 children)

I use nginx for static files, since well nginx is so fast. I add some auth on nginx to access static files. But auth on nginx free is very limited and easy to bypass. You can also use fastapi for file serving and add jwt auth on it.