You don't need to specify www in the domain when creating site with ee, just use ee site create example.com
and it will add the following line into your nginx config file server block:
`server {
server_name example.com www.example.com;
. . . . . . . . . . . . . . . . . .`
So both www and w/o domain will resolve to the same website, just make sure you add a CNAME record pointing www to the main site at your DNS management site or hosting.