nginx
is a server-side piece of the puzzle. With a single page application, the user hits your server (ideally) at most once to download the bundle, and then never again, until the application makes requests of its own accord, for instance to load some data or submit a form.
You say you want to log "every user action". Even on static HTML sites, nginx
access logs are not the correct tool for that job. User actions happen in the user's browser, not your server software. Logging as much as you can from the server side, you can still only guess at what the user is doing. Did they click on the link to go back home, the icon at the top of the page, a bookmark they have saved, open a new tab where their homepage is set to your website, etc.? You can never know.
The correct solution to your problem of wanting to log user interaction with an Angular SPA, is to log user interaction in the Angular SPA.
No affiliation or experience, but I hear Sentry is good. You can also write something yourself without too much trouble depending on your level of experience. In React applications, I generally dump the redux
action history to a JSON blob to attach to crash reports and that works perfectly well as a low-tech solution.
nginx
access logging is great and has its place, but its place is figuring out which endpoints are being hit at which times and by who, keeping tabs on active attacks, abusive request flooding, and so forth.