diff --git a/GIF_REGENERATION_GUIDE.md b/GIF_REGENERATION_GUIDE.md index 9009332..362bfb3 100644 --- a/GIF_REGENERATION_GUIDE.md +++ b/GIF_REGENERATION_GUIDE.md @@ -143,6 +143,29 @@ For each video in the database, the system will: - Ensure `/uploads/gifs/` directory is writable - Check file ownership and permissions +### GIFs return 404 but files exist on server + +This was a nginx configuration issue (fixed in commit bc688e5): + +**Problem:** nginx regex for static assets was catching ALL `.gif` files, including those in `/uploads/gifs/`, and trying to serve them from frontend `dist/` directory instead of proxying to backend. + +**Solution:** Updated nginx.conf to exclude `/uploads/` path from static asset caching: +```nginx +# Before (broken): +location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + expires 1y; + add_header Cache-Control "public, immutable"; +} + +# After (fixed): +location ~* ^/(?!uploads/).*\.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + expires 1y; + add_header Cache-Control "public, immutable"; +} +``` + +The negative lookahead `(?!uploads/)` ensures files under `/uploads/` are proxied to backend, not served as static assets. + ## Technical Details - **GIF Generator:** Uses ffmpeg with two-pass palette optimization @@ -167,5 +190,6 @@ Use Option 1 (Web UI) or Option 2 (Docker env var) from above. **Last updated:** 2026-01-18 **Docker image:** `git.matijaturk.from.hr/johnny2211/znakovni.hr:latest` -**Digest:** `sha256:5deeaa941152012c5c49823de607b365656ca21cdccb2d914a66e00497d45c9f` +**Digest:** `sha256:9d17eac2038678e8b65d54eb8a5f1b99974810f829ff414288deb849876db620` +**Latest commit:** `bc688e5` - Fix nginx configuration for GIF serving