What is Raspberry PI? 

Raspberry Pi is a series of small single-board computers (SBCs) developed in the United Kingdom by the Raspberry Pi Foundation in association with Broadcom.[15] The Raspberry Pi project originally leaned towards the promotion of teaching basic computer science in schools and in developing countries.[16][17][18] The original model became more popular than anticipated,[19] selling outside its target market for uses such as robotics. It is widely used in many areas, such as for weather monitoring,[20] because of its low cost, modularity, and open design. It is typically used by computer and electronic hobbyists, due to its adoption of HDMI and USB devices.

After the release of the second board type, the Raspberry Pi Foundation set up a new entity, named Raspberry Pi Trading, and installed Eben Upton as CEO, with the responsibility of developing technology.[21] The Foundation was rededicated as an educational charity for promoting the teaching of basic computer science in schools and developing countries.

You can use a web server on a Raspberry Pi to host a full website (locally on your network or globally on the internet), or just use it to display some information you wish to share to other machines on your network.

This Article will help you to setup Webserver with Nginx and PI. This Process will generally start After the setting up the initial Setup. Before Starting this setup You have to setup the ubuntu/Debian or any os with the Linux kernel for setting up Nginx on the Raspberry Pi. Even Windows has the availablity for the Nginx this article is based on ubuntu.

Refresh Database for available Packages

NGINX (pronounced engine x) is a popular lightweight web server application you can install on the Raspberry Pi to allow it to serve web pages. Like Apache, NGINX can serve HTML files over HTTP, and with additional modules can serve dynamic web pages using scripting languages such as PHP.

sudo apt update

Install Nginx

First install the nginx package by typing the following command in to the Terminal:

sudo apt install nginx

and Start the WebServer

sudo /etc/init.d/nginx start

Test the WebServer

By default, NGINX puts a test HTML file in the web folder. This default web page is served when you browse to http://localhost/ on the Pi itself, or http://192.168.1.10 (whatever the Pi's IP address is) from another computer on the network. To find the Pi's IP address, type hostname -I at the command line (or read more about finding your IP address).

Browse to the default web page either on the Pi or from another computer on the network and you should see the following:


Changing the default web page
NGINX defaults its web page location to /var/www/html on Raspberry Pi OS. Navigate to this folder and edit or replace index.nginx-debian.html as you like. You can confirm the default page location at /etc/nginx/sites-available on the line which starts with 'root', should you need to.

Create a html file with the code below on /var/www/html as home.html

<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>

</head>

<body>


<p class="container">

  <h1>Nginx</h1>

  <h2>Nginx</h2>

  <h3>Nginx</h3>

  <h4>Nginx</h4>

  <h5>Nginx</h5>

  <h6>Nginx</h6>

</p>


</body>

</html>

Change the bellow line on configuration default


# index index.php index.html index.htm;

index home.html;

Save and refresh your browser. You should see a page with the PHP version, logo and current configuration settings.

Good To Go!

Now you can Set the basic router configuration to your server so that the website is Visible on the Public net on public Ip.