Several Nginx tutorial links over the Internet recommends creating server blocks. My question is, do I need server blocks for my use case?
A server
block in nginx is the method to configure nginx to respond differently whenever requests arrive that either use a different port and/or do or do not use TLS encryption and/or contain different Host:
headers.
In other words: when for example www.example.com
and api.example.org
point to the same nginx instance and requests for http://www.example.com
or https://api.example.org
need to show different content, then you need server blocks for each.
Server blocks are also commonly used to ensure that content only shows when people make requests when visiting your domain and that requests with only your IP-address, or an ISP assigned hostname, or any other random domain won't display your brand and content. See: http://nginx.org/en/docs/http/request_processing.html
Server blocks can be omitted when you don't need such behaviour, but most people still set one up to keep their configuration tidy and future proof.
is it appropriate to dump all HTML files inside /var/www/html directory to display in front end app?
You might organise your content over some more subdirectories but up until a couple of thousand files a single flat directory won't be harmful.