Skip to content

Commit fd4955d

Browse files
authored
Merge pull request #2208 from odidev/nginx_LP
Deploy Nginx on the Microsoft Azure Cobalt 100 processors
2 parents 6e5f1ce + 4f19004 commit fd4955d

File tree

14 files changed

+575
-0
lines changed

14 files changed

+575
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Deploy NGINX on the Microsoft Azure Cobalt 100 processors
3+
4+
draft: true
5+
cascade:
6+
draft: true
7+
8+
minutes_to_complete: 30
9+
10+
who_is_this_for: This Learning Path introduces NGINX deployment on Microsoft Azure Cobalt 100 (Arm-based) virtual machine. It is intended for system administrators and developers looking to deploy and benchmark NGINX on Arm architecture with minimal adjustments from traditional x86_64 environments.
11+
12+
learning_objectives:
13+
- Start an Azure Arm64 virtual machine using the Azure console and Ubuntu Pro 24.04 LTS as the base image.
14+
- Deploy the NGINX web server on the Azure Arm64 virtual machine running Ubuntu Pro 24.04 LTS.
15+
- Configure and test a static website using NGINX on the virtual machine.
16+
- Perform baseline testing and benchmarking of NGINX in the Ubuntu Pro 24.04 LTS Arm64 virtual machine environment.
17+
18+
19+
prerequisites:
20+
- A [Microsoft Azure](https://azure.microsoft.com/) account with access to Cobalt 100 based instances (Dpsv6).
21+
- Familiarity with the [NGINX architecture](https://www.nginx.com/) and deployment practices on Arm64 platforms.
22+
- Network settings (firewalls and security groups) should allow inbound communication on ports 22 (SSH) and 80 (HTTP).
23+
24+
author: Jason Andrews
25+
26+
### Tags
27+
skilllevels: Advanced
28+
subjects: Web
29+
cloud_service_providers: Microsoft Azure
30+
31+
armips:
32+
- Neoverse
33+
34+
tools_software_languages:
35+
- NGINX
36+
- Apache Bench
37+
38+
operatingsystems:
39+
- Linux
40+
41+
further_reading:
42+
- resource:
43+
title: NGINX official documentation
44+
link: https://nginx.org/en/docs/
45+
type: documentation
46+
- resource:
47+
title: Apache Bench official documentation
48+
link: https://httpd.apache.org/docs/2.4/programs/ab.html
49+
type: documentation
50+
- resource:
51+
title: NGINX on Azure
52+
link: https://docs.nginx.com/nginx/deployment-guides/microsoft-azure/virtual-machines-for-nginx/
53+
type: documentation
54+
55+
56+
### FIXED, DO NOT MODIFY
57+
# ================================================================================
58+
weight: 1 # _index.md always has weight of 1 to order correctly
59+
layout: "learningpathall" # All files under learning paths have this same wrapper
60+
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
61+
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# ================================================================================
3+
# FIXED, DO NOT MODIFY THIS FILE
4+
# ================================================================================
5+
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
6+
title: "Next Steps" # Always the same, html page title.
7+
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
8+
---
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: "Overview"
3+
4+
weight: 2
5+
6+
layout: "learningpathall"
7+
---
8+
9+
## Cobalt 100 Arm-based processor
10+
11+
Azure’s Cobalt 100 is built on Microsoft's first-generation, in-house Arm-based processor: the Cobalt 100. Designed entirely by Microsoft and based on Arm’s Neoverse N2 architecture, this 64-bit CPU delivers improved performance and energy efficiency across a broad spectrum of cloud-native, scale-out Linux workloads. These include web and application servers, data analytics, open-source databases, caching systems, and more. Running at 3.4 GHz, the Cobalt 100 processor allocates a dedicated physical core for each vCPU, ensuring consistent and predictable performance.
12+
13+
To learn more about Cobalt 100, refer to the blog [Announcing the preview of new Azure virtual machine based on the Azure Cobalt 100 processor](https://techcommunity.microsoft.com/blog/azurecompute/announcing-the-preview-of-new-azure-vms-based-on-the-azure-cobalt-100-processor/4146353).
14+
15+
## NGINX
16+
17+
NGINX is a high-performance, open-source web server, reverse proxy, load balancer, and HTTP cache. Originally developed by Igor Sysoev, NGINX is known for its event-driven, asynchronous architecture, which enables it to handle high concurrency with low resource usage.
18+
19+
There are three main variants of NGINX:
20+
- **NGINX Open Source**– Free and [open-source version available at nginx.org](https://nginx.org)
21+
- **NGINX Plus**- [Commercial edition of NGINX](https://www.nginx.com/products/nginx/) with features like dynamic reconfig, active health checks, and monitoring.
22+
- **NGINX Unit**- A lightweight, dynamic application server that complements NGINX. [Learn more at unit.nginx.org](https://unit.nginx.org/).
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
title: NGINX Baseline Testing
3+
weight: 5
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
10+
### Baseline testing with a static website on NGINX
11+
Perform baseline testing of NGINX on an **Ubuntu Pro 24.04 LTS** virtual machine by deploying a custom static HTML page. This verifies that NGINX is correctly serving content on the Arm64 platform.
12+
13+
1. Create a Static Website Directory:
14+
15+
Prepare a folder to host your HTML content.
16+
```console
17+
mkdir -p ~/my-static-site
18+
```
19+
2. Create an HTML file and Web page:
20+
21+
Create a HTML file `nano my-static-site/index.html` with the content below to design a visually appealing static landing page.
22+
23+
```html
24+
<!DOCTYPE html>
25+
<html lang="en">
26+
<head>
27+
<meta charset="UTF-8">
28+
<title>Welcome to NGINX on Azure Ubuntu Pro</title>
29+
<style>
30+
body {
31+
background: linear-gradient(to right, #4facfe, #00f2fe);
32+
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
33+
display: flex;
34+
justify-content: center;
35+
align-items: center;
36+
height: 100vh;
37+
margin: 0;
38+
color: white;
39+
text-align: center;
40+
}
41+
.box {
42+
background: rgba(0, 0, 0, 0.3);
43+
padding: 40px;
44+
border-radius: 12px;
45+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
46+
}
47+
h1 {
48+
margin-bottom: 10px;
49+
font-size: 2.5rem;
50+
}
51+
p {
52+
font-size: 1.2rem;
53+
}
54+
</style>
55+
</head>
56+
<body>
57+
<div class="box">
58+
<h1> Welcome to NGINX on Azure Ubuntu Pro 24.04 LTS!</h1>
59+
<p>Your static site is running beautifully on ARM64 </p>
60+
</div>
61+
</body>
62+
</html>
63+
```
64+
3. Move the Website to NGINX's Accessible Directory:
65+
66+
Since NGINX runs under the `www-data` user and may not have access to files inside `/home/ubuntu`, move the site to a directory where NGINX has permissions by default:
67+
68+
```console
69+
sudo mkdir -p /var/www/my-static-site
70+
sudo cp -r ~/my-static-site/* /var/www/my-static-site/
71+
sudo chown -R www-data:www-data /var/www/my-static-site
72+
```
73+
74+
4. Create NGINX Config File to Serve Static Website:
75+
76+
Point NGINX to serve your static HTML content.
77+
```console
78+
sudo nano /etc/nginx/conf.d/static-site.conf
79+
```
80+
Now, add the following configuration:
81+
82+
```NGINX
83+
server {
84+
listen 80;
85+
server_name localhost;
86+
87+
location / {
88+
root /var/www/my-static-site;
89+
index index.html;
90+
}
91+
92+
access_log /var/log/nginx/static-access.log;
93+
error_log /var/log/nginx/static-error.log;
94+
}
95+
```
96+
Make sure `/home/ubuntu/my-static-site` is the correct path to your **index.html**.
97+
98+
5. Test the NGINX Configuration:
99+
100+
```console
101+
sudo nginx -t
102+
```
103+
You should see an output similar to:
104+
```output
105+
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
106+
nginx: configuration file /etc/nginx/nginx.conf test is successful
107+
```
108+
109+
6. Reload or Restart NGINX:
110+
111+
Apply configuration changes and restart the web server.
112+
```console
113+
sudo nginx -s reload
114+
sudo systemctl restart nginx
115+
```
116+
117+
7. Test the Static Website on browser:
118+
119+
Access your website at your public IP on port 80.
120+
```console
121+
http://<your-vm-public-ip>/
122+
```
123+
Make sure port 80 is open in your Azure Network Security Group (NSG).
124+
125+
8. You should see the NGINX welcome page confirming a successful deployment:
126+
127+
![Static Website Screenshot](images/nginx-web.png)
128+
129+
This verifies the basic functionality of NGINX installation before proceeding to the benchmarking.

0 commit comments

Comments
 (0)