Note that in the demonstration environment, the instance has a public facing IP address and no network security is applied. Depending on your production environment, you may need to configure additional security list rules or update your network security group configuration.
Test your deployment
With your web browser, go to the domain name or IP address of the compute instance. This is the same IP address that you used to SSH into the instance.
The NGINX web server opens the default test page /usr/share/nginx/html/index.html.
Create a custom NGINX configuration
To change the root path for your web server, do not edit the /etc/nginx/nginx.conf file directly. Instead, as a preferred method, create a site-specific configuration in the /etc/nginx/conf.d directory. For example, create the file /etc/nginx/conf.d/default.conf and populate it with a configuration for your site.
The following steps can be used to set up a dedicated site configuration:
Create a directory to host a new site
sudo mkdir /srv/website
Create an index.html file to display to visitors to the new site.
Replace the <IP_address> values with the public IP address for the instance.
Note that if you are hosting for multiple domains, you can specify different ssl_certificate and ssl_certificate_key values for each server_name configuration that you create in the /etc/nginx/conf.d directory.
Restart the NGINX service to load the new configuration.
sudo systemctl restart nginx
Configure the firewall (optional)
Enable the firewall port (443) for the NGINX HTTPS web service and reload the default firewall service.