Commit Graph

4 Commits

Author SHA1 Message Date
lebaudantoine
5bac9a1d59 🔒️(frontend) hide Nginx server version in error responses
Remove version disclosure in /assets/ error pages identified by security
auditor to prevent information leakage vulnerability.
2025-06-03 15:17:21 +02:00
antoine lebaud
0a9e077f04 ️(frontend) add caching headers for static assets in Nginx config
Configured Nginx to set caching headers for static assets by adding
a location block to match common static file extensions and set
an expiration time of 30 days.

It should result in faster loading times, reduced bandwidth usage,
and a more efficient and responsive user experience.

Wdyt @manuhabitela?
2024-07-15 17:56:03 +02:00
antoine lebaud
eac107aac6 🐛(frontend) fix Nginx configuration for SPA routing with Vite
Configured Nginx to serve index.html for all requests, allowing
the client-side router (Wouter) to manage the routing.

Added a try_files directive to attempt to serve static files first,
falling back to index.html if the requested file is not found.

Added an error_page directive to handle 404 errors by internally
redirecting to index.html without modifying the URL path.

Wouter should make the rest.
2024-07-15 17:56:03 +02:00
antoine lebaud
f051938ace (frontend) introduce frontend Docker image
Inspired by the Docker images from numerique-gouv/people and numerique-gouv/impress
(see commit 1a3b396 in the "people" repository).

Due to the lack of a certified cold storage solution (e.g., S3) for serving static files,
we've containerized the frontend as a temporary deployment solution.

Vite.js static output is served using an Nginx reverse proxy.

I am not quite sure of this commit, please @manuhabitela could you review how I exposed
the static build from vite in my Nginx server? and do the appriopriate fix if necessary.
2024-07-01 20:35:47 +02:00