Challenge 1: The SPA Location Block — Solution Walkthrough The configuration: location / { try_files $uri $uri/ /index.html; } Why this works: A single location / {} block matching every request is enough here — try_files itself does the actual candidate-checking work described in this chapter. For any incoming request, Nginx first checks whether $uri (the exact requested path) exists as a real file; if not, whether $uri/ exists as a directory; and if neither exists, it falls back to serving /index.html instead of returning a 404. Once index.html loads, the single-page application's own client-side router takes over and displays the right view based on the URL, even though no real file matched that URL on the server. WHY THIS WORKS AS AN ANSWER ------------------------------ This exercise is a direct, hands-on application of this chapter's own try_files example to the exact SPA scenario it was introduced to solve, confirming the $uri / $uri/ / /index.html candidate order as the actual mechanism rather than a fixed example tied to one specific app.