🐛 proxy the whole /api namespace, not an allowlist
Browse files at this commit905655a8a587cceaba4f2e8f2a24f7dff7d471ddParent: c19a9d5- fix
- 🐛 proxy the whole /api namespace, not an allowlist
1 changed file +6 -1
- nginx.conf +6 -1
nginx.confmodified+6 -1
| @@ -3,7 +3,12 @@ server { | |||
| 3 | root /usr/share/nginx/html; | 3 | root /usr/share/nginx/html; |
| 4 | index index.html; | 4 | index index.html; |
| 5 | 5 | ||
| 6 | - location ~ ^/api/(auth|users|notes|events|exams|courses|sessions|marks|attendance|work|pomodoro|settings|subjects|terms|health|time)(/|$) { | 6 | + # Proxy the whole /api/* namespace, not a hand-maintained allowlist: an |
| 7 | + # enumerated list silently 404s (falls through to the SPA -> HTML -> the | ||
| 8 | + # client's JSON.parse fails) every time the backend or frontend gains a | ||
| 9 | + # resource the list forgot. homework, messages, and questions were all | ||
| 10 | + # already broken this way. | ||
| 11 | + location /api/ { | ||
| 7 | rewrite ^/api(/.*)$ $1 break; | 12 | rewrite ^/api(/.*)$ $1 break; |
| 8 | proxy_pass http://hezarfen-backend:8080; | 13 | proxy_pass http://hezarfen-backend:8080; |
| 9 | proxy_http_version 1.1; | 14 | proxy_http_version 1.1; |