You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why does a Playwright security test return HTTP 403 instead of the expected HTTP 404 when using Vite rather than production Nginx?
Answer
During my AI Dev Tools Zoomcamp 2026 final project, AI OfficeFlow, I encountered a browser-testing issue caused by differences between the development and production environments.
Problem: The production frontend used Nginx to block access to private routes with HTTP 404. However, the Cloud test environment used Vite, which forwarded certain requests to the API and returned HTTP 403.
As a result, 14 out of 15 browser tests passed, while one security assertion failed.
Checklist
I have searched existing FAQs and this question is not already answered
The answer provides accurate, helpful information
I have included any relevant code examples or links
Activity
github-actions commentedon Oct 21, 2026
✅ FAQ NEW proposal created in PR #488
Please review and approve the changes.
chakirou18 commentedon Oct 21, 2026
How to solve it:
Do not weaken security tests simply to make them pass in development.
After testing in the intended local environment, all 15 browser tests passed.