As I mentioned in the previous post, you'll need to create a configuration file for each website you want to host. The configuration file will contain information on where the website lives on your server, among other things. I'll show you how to write a basic one and use it to make your website live!
I'll use a really basic "Hello, World" kind of website as an example website.
Let's call it vincentchov.com and all it is is a single HTML file that says "Hello World!".
Create a folder called "vincentchov.com" (or whatever your domain name is):
(mkdir ~/vincentchov.com
) and inside it, create an HTML
file called index.html and have it contain <a>Hello World!</a>
.
on your server, among other things. The default folder where Nginx assumes you'll
store your websites is at /var/www/html
and while you can change that, I'll
stick to convention so my advice applies better when you read other people's guides.
Provided you already made the vincentchov.com folder in your Home folder, move it to
/var/www/html, which will need sudo permissions:
sudo mv ~/vincentchov.com /var/www/html
. Awesome! Now let's write a config file
so Nginx actually knows what to do with the site!