Home Operation and Maintenance Nginx What does nginx reverse proxy mean?

What does nginx reverse proxy mean?

Jun 20, 2019 pm 03:16 PM
nginx reverse proxy

What does nginx reverse proxy mean?

1. Background introduction

Nginx (engine x) is a high-performance HTTP and reverse proxy server , Nginx is a lightweight web server/reverse proxy server and email proxy server. Its characteristics are that it occupies less memory and has strong concurrency capabilities. In fact, nginx’s concurrency capabilities do perform better among web servers of the same type. Users of nginx websites in mainland China include: Baidu, JD.com, Sina, NetEase, Tencent, Taobao, etc.

2. Knowledge analysis

1. Proxy server

Generally refers to the machine inside the LAN sending requests to the server on the Internet through the proxy server. The proxy server generally acts on the client end. A complete proxy request process is: the client first creates a connection with the proxy server, and then requests to create a connection to the target server or obtain the specified resources of the target server according to the proxy protocol used by the proxy server. Web proxy (proxy) server is the intermediate entity of the network. The proxy is located between the web client and the web server, playing the role of "middleman". The HTTP proxy server is both a Web server and a Web client.

2. Forward proxy

The forward proxy is a server between the client and the origin server. In order to obtain content from the origin server, the client sends a Request and specify the target (origin server), then the proxy forwards the request to the origin server and returns the obtained content to the client. The client must make some special settings to use the forward proxy.

3. Reverse proxy

Reverse proxy In the computer world, there is a limit to the ability of a single server to handle client (user) requests. When user access requests flood in, Sometimes, it will cause the server to be overwhelmed. Multiple servers can be used to share thousands of user requests. These servers provide the same service, and users will not feel any difference at all. The server accepts the client's request, then distributes the request to a specific server for processing, and then feeds the server's response back to the client.

4. Implementation of reverse proxy

1) A load balancing device is required to distribute user requests and distribute user requests to idle servers;

2) The server returns its own services to the load balancing device;

3) The load balancing returns the server's services to the user;

3. Frequently Asked Questions

1. Forward proxy and reverse proxy What is the difference between reverse proxy

2. Why use reverse proxy

4. Solution

Answer: 1. The difference between the two is that the objects of the proxy are different: The object represented by the proxy is the client, and the object represented by the reverse proxy is the server.

Answer: 2. Facilitate server distribution and expansion. In practice, there is a limit to the ability of a single server to handle client requests. When the number of requests is too large, the server will be too busy. Therefore, multiple servers are used to share the user's request processing. These servers provide the same service. For users, no difference. Then a load balancing device is needed to distribute user requests to idle servers, and then the server returns the results to the load balancing device, and the load balancing returns them to the user. In this way, when adding/removing a server, you only need to modify the load balancing server list without affecting server security. Avoid direct exposure of IP addresses and ports to the Internet, preventing hosts from being exploited for security vulnerabilities. The number of proxy servers is limited, making security protection more convenient.

5. References

Baidu, books

6. More discussions

1. What are the load balancing algorithms?

Answer: Round Robin method, random (Random) method, source address hash (Hash) method, weighted round robin (Weight Round Robin) method, weighted random (Weight Random) method, minimum Least Connections method.

2. What does the server name in the configuration mean?

Answer:

The server_name directive in Nginx is mainly used to configure name-based virtual hosts. The matching order of the server_name directive after receiving the request is:

1, Exact server_name matches

2, string starting with * wildcard character

3, string ending with * wildcard character

4, matching regular expression:

3. What is the difference between reverse proxy and load balancing?

Answer: Reverse proxy is a method to achieve load balancing. Let’s talk about reverse proxy first. When the user makes a request, he first sends the request to the proxy server, and then the proxy server requests the real server according to the algorithm, and finally returns it to the user. This approach, firstly, improves security; secondly, it shares user requests through multiple real servers and achieves load balancing. Let’s talk about load balancing again. The emergence of load balancing is to reduce the pressure on a single server as much as possible through horizontal expansion. Common WEB-level load balancing solutions include hardware F5, Nginx proxy, LVS, load balancing services of various cloud providers (such as AWS ELB service), etc. What is connected behind the load balancing is usually the server that actually provides the service. For example, through the ELB service, the traffic can be evenly shared, thereby reducing the pressure on the stand-alone server.

For more Nginx related technical articles, please visit the Nginx Tutorial column to learn!

The above is the detailed content of What does nginx reverse proxy mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to check the name of the docker container How to check the name of the docker container Apr 15, 2025 pm 12:21 PM

You can query the Docker container name by following the steps: List all containers (docker ps). Filter the container list (using the grep command). Gets the container name (located in the "NAMES" column).

How to configure cloud server domain name in nginx How to configure cloud server domain name in nginx Apr 14, 2025 pm 12:18 PM

How to configure an Nginx domain name on a cloud server: Create an A record pointing to the public IP address of the cloud server. Add virtual host blocks in the Nginx configuration file, specifying the listening port, domain name, and website root directory. Restart Nginx to apply the changes. Access the domain name test configuration. Other notes: Install the SSL certificate to enable HTTPS, ensure that the firewall allows port 80 traffic, and wait for DNS resolution to take effect.

How to check nginx version How to check nginx version Apr 14, 2025 am 11:57 AM

The methods that can query the Nginx version are: use the nginx -v command; view the version directive in the nginx.conf file; open the Nginx error page and view the page title.

How to configure nginx in Windows How to configure nginx in Windows Apr 14, 2025 pm 12:57 PM

How to configure Nginx in Windows? Install Nginx and create a virtual host configuration. Modify the main configuration file and include the virtual host configuration. Start or reload Nginx. Test the configuration and view the website. Selectively enable SSL and configure SSL certificates. Selectively set the firewall to allow port 80 and 443 traffic.

How to check whether nginx is started How to check whether nginx is started Apr 14, 2025 pm 01:03 PM

How to confirm whether Nginx is started: 1. Use the command line: systemctl status nginx (Linux/Unix), netstat -ano | findstr 80 (Windows); 2. Check whether port 80 is open; 3. Check the Nginx startup message in the system log; 4. Use third-party tools, such as Nagios, Zabbix, and Icinga.

How to start containers by docker How to start containers by docker Apr 15, 2025 pm 12:27 PM

Docker container startup steps: Pull the container image: Run "docker pull [mirror name]". Create a container: Use "docker create [options] [mirror name] [commands and parameters]". Start the container: Execute "docker start [Container name or ID]". Check container status: Verify that the container is running with "docker ps".

How to create containers for docker How to create containers for docker Apr 15, 2025 pm 12:18 PM

Create a container in Docker: 1. Pull the image: docker pull [mirror name] 2. Create a container: docker run [Options] [mirror name] [Command] 3. Start the container: docker start [Container name]

How to start nginx server How to start nginx server Apr 14, 2025 pm 12:27 PM

Starting an Nginx server requires different steps according to different operating systems: Linux/Unix system: Install the Nginx package (for example, using apt-get or yum). Use systemctl to start an Nginx service (for example, sudo systemctl start nginx). Windows system: Download and install Windows binary files. Start Nginx using the nginx.exe executable (for example, nginx.exe -c conf\nginx.conf). No matter which operating system you use, you can access the server IP

See all articles