I have an nginx server serving plain HTML and JS files.
The js code then calls various REST API to GET/POST data from API servers.
If nginx receives a request for /api/ location, it forwards the request to another server which handles all the APIs. This api server is built in Ruby on Rails.
Since all my plain HTML pages are delivered by nginx directly, I cant have server side sessions while they are rendered.
What can I do to prevent CSRF attacks?