if I don't have an domain and what I have is IP address.. how can I create a virtual host? can someone give me an example of a nginx.conf file?
Use hosts file. Add server directive to nginx config:
Add example.com to your local system hosts files(%SystemRoot%\system32\drivers\etc\ in Windows):
Also you can use DynDNS.
You either need to use a non name based virtual host at which point you can only have one site per IP address, in this case you can just type the IP into your webbrowser. The default nginx config on most systems should already have this setup for you
If you want to put more than site on an IP you have to use name based virtualhosts, you set these up as normal if you did have a domain name, but to be able to see them you would have to edit your hosts file to add the domain records you set your virtualhosts on. You would have to do this on every computer you want to access those sites from and it does require admin privileges to each machine
NOTE: you dont actually need to own the domains you use, but i would recommend it or at least not using common domains