New to the nuggets, Nginx, a lot of advice.

What is Nginx?

Nginx is a lightweight, high-performance HTTP and reverse proxy server, as well as a powerful tool for high-concurrency scenarios.

What’s Nginx for?

There are three common uses of Nginx:

  1. Static HTTP Server

Nginx itself is a static server. We can use the forwarding function of Nginx to arrange static resources in the path of Nginx itself, so as to realize the separation of static and static resources and efficient resource access.

  1. Reverse proxy server

In reverse proxy mode, Nginx acts as a proxy server to receive the request from the client, forwards the request to other servers on the internal network, receives the response from the server and returns the result to the client. At this point Nginx acts as the client to make the request to the server.

  1. Load balancing

Load balancing is a common function of Nginx in high-concurrency scenarios. Nginx distributes server requests to multiple servers based on its configured load balancing policy to reduce server pressure and improve data throughput.

How to use Nginx?

As the ultimate Nginx entry group, we must be skilled in Nginx installation and uninstall, this is a highly profitable business. As the saying goes, there is no problem that can’t be solved by unloading and reloading. If there is, then two.

Installation and uninstallation in Linux

Yum, yum, yum, yum, yum

  • Switch to the administrator account to ensure the success of subsequent operations.sudo su
  • Check the Linux operating system version and ensure that the Linux operating system is in centos7.cat /etc/redhat-release
  1. First you need to add the Nginx to yum repository, the RPM – the ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

  2. Install Nginx using yum, yum install Nginx

  3. Start the Nginx service, systemctl start Nginx

  4. The service starts successfully.

  5. To stop the Nginx service, run systemctl stop Nginx

  6. Delete files related to Nginx

    rm -rf /usr/sbin/nginx
    rm -rf /etc/nginx
    rm -rf /etc/init.d/nginx
    Copy the code
  7. Remove Nginx from yum, yum remove Nginx

At this point, back to the original starting point, Nginx has wandered a long way, but left no trace. Learn Nginx uninstall and installation, encountered problems za do not panic. Learn together, make progress together, come on, XDM!