Download the nginx package that corresponds to the current system version (package)
# wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
Create a yum repository for nginx
# rpm -ivhnginx-release-centos-7-0.el7.ngx.noarch.rpm
Download and install nginx
# yum install nginx
Start the nginx service
systemctl start nginx
configure
default configure The document is in /etc/nginx under the path, Use this configure It already works correctlynginx; If you need to customize, Modify thenginx.conf Just wait for the file。
test (machinery etc)
Type the IP of the machine where the nginx environment is deployed into the browser address bar and if everything is working, you should see something like the following.
END
caveat emptor
Unless specifically stated or in configure Outside the context of the document,'#' The opening statement indicates the content of the command entered in the terminal