跟读练习: NGINX Explained - What is Nginx - 通过视频学习英语口语
正在创建课程...
1
By the end of this video, you will know not only what Nginx is,
2
but also why it was created and what it's used for with real life examples.
3
Back in the day when the web was still simple with less users, the basic use case was a browser requested a web page from one web server.
4
The web server was a server machine that had a software installed on it
5
that assembled the page and sent it back to the browser, which then displayed it to the user a piece of software
6
that runs on a server machine and can respond to requests from a browser.
7
And that web server software, that was Nginx, a piece of software that runs on a server machine and can respond to requests from a browser.
8
Then web became popular, so you had thousands or millions of requests per website.
9
Imagine one single server handling millions of requests.
10
That's way over the technical limit of a server software.
11
Well, we need a few more servers to handle that load.
12
So we added 10 Nginx web servers.
13
But now we need something that determines where requests from the browser and which one of those 10 servers will handle them.
14
And that's where load balancing comes in.
15
So the same Nginx web server becomes a load balancer that proxies the requests to those 10 web servers.
16
And by the way, the word proxy means to do something on someone else's behalf.
17
So it accepts the browser requests on behalf of the web servers.
18
like a concierge
19
and then distributes the load among the web servers now how does it distribute the load
20
that depends on whichever algorithm was configured on it it could
21
be a simple logic such as just whichever server is least busy gets the request
22
or it could be a round robin which is a popular algorithm
23
that basically distributes the requests equally in a cyclical manner So very simple load balancing logic.
24
So now we have Nginx as web server software.
25
and the proxy as well and
26
that load balancing is just one of the functionalities of nginx proxy
27
so it's the same server and technology but with a different task now
28
so what are those other features or functionalities of a proxy
29
Imagine New York Times article comes out and millions of people open it on their laptops in the browser.
30
Now imagine every time the request landed with one of the web servers that assembled the response,
31
like put the images together, get them from a database, put text and paragraphs and everything together, edit all the links, sent it back as a response.
32
to assemble this article, get all the data from a database, put the text and links and everything together once and store it.
33
It's a static article, it's not going to change, right?
34
So just keep one final copy and send it to everyone who requests it.
35
That's caching functionality and it is another main feature of Nginx Proxy server.
36
So you can configure caching on Nginx Proxy
37
so you don't have to hit the database or the web servers every time a request comes in.
38
It will just return that cached file.
39
Now imagine we have 100 servers of an online banking application or a social network like Facebook.
40
That makes those servers a pretty juicy target for hackers.
41
They all want to hack into your servers and get the treasure, which is payment data, personal data, passwords, and so on.
42
Now imagine you exposed all 100 servers to public access.
43
So basically all those requests can directly hit each of the web servers.
44
hackers so much easier.
45
They would need to find just one issue in one of those hundred servers, and they could potentially break into your entire system.
46
Because all your servers are publicly accessible directly, they can just ping the hell out of them
47
and probe them until they find an issue or an entry because you forgot to update a library or a software package, and they can hack your web server application.
48
So you have to worry about absolutely perfectly securing hundred servers.
49
Instead, we just give them one server.
50
That is the only one that's publicly accessible.
51
You can put all your tightest security efforts on one server instead of 100 servers.
52
And this way having one entry point, which is the proxy, as publicly accessible entry point,
53
reduces the security attack surface tremendously and basically acts like a shield or security layer before all those web servers.
54
So in addition to load balancing and caching,
55
a very, very important functionality of a proxy is an edit security for your web servers.
56
Now talking about security, I mentioned that since we have one entry point, we can focus all our efforts to securing that one proxy server in all aspects.
57
And one important security measure is encrypted communication.
58
So front -end will send encrypted message to the proxy, which means even if an attacker sees that traffic on user's browser or during the transmission, they can't read it.
59
Only the proxy server can decrypt it.
60
But again, for edit security in many systems, proxy that acts as a shield,
61
a security shield, will simply pass on that encrypted message to the web servers and the web server will decrypt it.
62
itself which is actually a better security practice.
63
So here the functionality of a proxy is to be able to accept encrypted traffic with SSL encryption.
64
So you can configure your proxy to deny any requests that is not encrypted and only accept encrypted requests.
65
Now imagine Netflix, which by the way uses Nginx in its backend.
66
And as we know, Netflix has millions of users, so it's getting millions of requests for videos on its web servers.
67
And let's say it's an evening in New York, millions of people come home after work, All at the same time,
68
they switch on Netflix and start watching the most popular series at that time.
69
That means suddenly at the very same time, millions of requests for a high quality video is sent to Netflix.
70
So in this case, imagine
71
that Nginx proxy server would have to send back the entire high quality video to millions of users at once.
72
That's a lot of bandwidth.
73
internet cables all the way to the TVs of millions of viewers.
74
That's where compression helps nginxproxy can also be configured to compress large images
75
or video files to save bandwidth both on the side of the clients
76
so people who are receiving those large files
77
but also on the server side who is sending all
78
that content so it arrives faster and it uses up less of your internet bandwidth
79
and as part of it it also supports sending responses in chunks instead of the entire
80
part of the video and then by the time you have watched the first half, the second half of the video has been sent over to you as well.
81
So these are all the functionalities that you can configure for Nginx as a proxy server.
82
Now, you may be thinking, how do you make Nginx do all these things?
83
How do you configure them?
84
How do you tell Nginx whether it should act as a web server or a proxy server?
85
And how do you configure all this caching and SSL traffic and all this stuff?
86
Well, that's where Nginx configuration file comes in, which lets you define all this configuration with so -called directives.
87
This is where you can define whether you want your Nginx to be a web server or a proxy server,
88
simply by configuring whether it should forward the traffic to other web servers or whether it should handle it itself.
89
You can configure which port you want Nginx server to listen on.
90
This is an example of a simple web server configuration
91
that listens on port 80
92
and with location basically defines from where in the file system it should serve those static files back but as we learned,
93
communicating on port 80 or HTTP port is insecure.
94
Instead, we want to encrypt all the communication.
95
And you can configure
96
that easily in Nginx to route any traffic coming on port 80 to HTTPS by sending those requests to HTTPS endpoint.
97
key and the private key for the SSL communication and it listens on the HTTPS port 443.
98
So that's a simple configuration that allows you to tweak Nginx to handle requests like that.
99
You also have its own configuration to configure load balancing to multiple backend servers
100
and within that configuration you can also define which load balancing algorithm to use like select the least which as I said,
101
just equally distributes the load in a cyclical order between those servers.
102
You also have the caching configuration with multiple different elements, like how long the cache should be stored before it's refreshed and so on.
103
And as you see, the configuration of all these functionalities is pretty straightforward, and it's also pretty granular.
104
Like you can do tons of different configurations with Nginx, directives in this list here,
105
which is a pretty huge list, and you see the configurations for proxy functionalities have proxy prefix, so you can differentiate them as well.
106
Now, Nginx is very flexible, as you see, and super fast as well.
107
So it became very popular in containers as well
108
and made its way as one of the most popular solutions for Kubernetes Ingress Controller functionality.
109
Ingress Controller is essentially a proxy with advanced load balancing functionality, but for Kubernetes.
110
So what Nginx was doing for simple web servers, it's now doing for Kubernetes Cluster in the form of Ingress Controller.
111
proxy and load balancer that receives the incoming traffic first and then based on the configuration that we define,
112
forwards it to the right service inside the cluster.
113
Now, this load balancing configuration as well as the logic is more advanced and more Kubernetes specific, but the idea is pretty much the same.
114
And I actually have full videos on Ingress and Ingress controller and how to configure it.
115
You can watch on my channel.
116
In fact, I create these tutorials regularly on a lot of interesting technology.
117
So if you want to educate yourself in tech, make sure to subscribe and activate notification to get those new tutorial videos.
118
Now there are actually many English controller implementations out there for Kubernetes but Nginx is one of the most popular ones.
119
And I have actually used Nginx Ingress Controller in most of my projects as well.
120
Now, some of you may be thinking, doesn't each cloud platform have its own load balancer?
121
Why do I need Nginx as a load balancer?
122
Well, you actually need both.
123
Nginx Ingress Controller, which acts as a load balancer, is used inside the cluster.
124
accessible so you can't access the nginx ingress controller directly from the browser it actually lives inside the cluster network
125
and forwards the requests internally
126
so who is getting the requests from public what is the
127
public entry point for the browser requests that's the cloud load balancer like aws elb for example
128
which then forwards that request to the ingress controller inside the very important security layer to those requests.
129
So the cluster component is never directly exposed to public access.
130
Instead, every request comes from the cloud load balancer, which then forwards it to the Ingress controller within the cluster,
131
which then routes the traffic based on intelligent logic to different applications within the cluster.
132
And with intelligent routing, what I mean is, of sub -segments or microservices, for example, you can configure your English controller.
133
So if the request URL includes Online cart, it routes the traffic to online cart microservice.
134
If it includes payment, it routes the traffic to payment service and so on.
135
Now, some of you who've been in IT for a little longer may have worked with Apache web server.
136
So what's the difference between Apache web server and Nginx web server?
137
Well, not much, actually.
138
Nginx and Apache web servers do pretty much the same thing.
139
Just like Nginx, Apache also used to be a basic web server,
140
extended its functionality as a proxy and it has all these benefits and functionalities of a proxy that we discussed.
141
Apache was actually already widely used when Nginx was created and the major benefit of Nginx was that it was faster,
142
more lightweight and definitely had an advantage when it came to serving huge amounts of static files.
143
Plus, as you saw, it has a pretty easy configuration as well.
144
And Nginx also became more popular in the container world.
145
Now, I hope you got a clear overview of what Nginx is
146
and hope I've answered all the questions you may have had while learning about Nginx.
147
And with that, thank you for watching and see you in the next video.
📺 同频道
✨ 推荐视频
本节内容简介
在本节中,您将学习有关 Nginx 的基础知识,包括它的创建原因以及实际应用示例。通过观看视频并进行英语影子跟读,您将能够提升您的雅思口语练习技能,深入理解网络服务器的工作原理,并提高您的英语听说能力。同时,您将练习如何在快速对话中抓住关键词,促进语言流利度的提升。
关键词汇与短语
- Nginx - 一种运行在服务器上的软件,可以处理来自浏览器的请求。
- 负载均衡 - 指定请求将如何在多台服务器之间分配。
- 代理 - 代替他人执行某项操作的行为。
- 缓存 - 一个存储静态内容的功能,以减少服务器负担。
- 安全性 - 确保服务器不被攻击者黑客入侵的措施。
- 请求 - 浏览器向服务器发送的获取数据的指令。
练习技巧
在进行这一节的影子跟读练习时,请注意视频中的语速和语调。尽量模仿说话者的发音和断句,尤其是当他谈论技术概念时,语速可能会稍快。您可以尝试在每个短句后暂停,重复听到的内容。可以通过选择更慢速的播放选项来帮助自己适应。同时,集中注意每个关键词汇的发音,例如“负载均衡”与“缓存”,这些都是理解内容的关键。当您跟读这些专业术语时,确保发音准确,以便增强您的英语交流能力。通过反复练习,您将逐步掌握这些高频词汇的使用和语境。观看此视频是一个绝佳的机会,通过看 YouTube 学英语,您不仅能增进您的听力理解能力,还可有效提升口语表达的自然度。将这项英语影子跟读技巧融入您的日常学习,将会带来显著的效果。
什么是跟读法?
跟读法 (Shadowing) 是一种有科学依据的语言学习技巧,最初开发用于专业口译员的培训,并由多语言者Alexander Arguelles博士普及。这个方法简单而强大:您在听英语母语原声的同时立即大声重复——就像是一个延迟1-2秒紧跟说话者的影子。与被动听力或语法练习不同,跟读法强迫您的大脑和口腔肌肉同时处理并模仿真实的讲话模式。研究表明它能显着提高发音准确性,语调,节奏,连读,听力理解和口语流利度——使其成为雅思口语备考和真实英语交流最有效的方法之一。
















