Nginx Version: Version 1.9.3
Note: The package involved in the article can be added to the bottom of the free access
Installing a dependency package with Yum
#yum install gcc zlib zlib-devel OpenSSL openssl-devel pcre pcre-develncurse -y
#cd/USR/LOCAL/SRC
#tar-zxvf/usr/local/src/nginx-1.9.3.tar.gz
#cd nginx-1.9.3
#./configure--prefix=/usr/local/nginx--with-http_realip_module--with-http_sub_module--with-http_gzip_static_ Module--with-http_stub_status_module--with-pcre--with-http_ssl_module
#make && make Install
Configure Nginx
#cd/usr/local/nginx/conf/
#mv nginx.conf Nginx.conf.bak
The following is a simple reverse proxy:
The request to access http://192.168.8.156:80 as shown will be forwarded to http://192.168.0.186:9890
Start method
#/usr/local/nginx/sbin/nginx
You can also use the/etc/init.d/nginxstart|stop|restart method
Upload the Nginx boot script in the attachment to/etc/init.d/
#chmod 755/etc/init.d/nginx//Empowerment
#chkconfig--add nginx//Add Nginx for system service
#chkconfig Nginx on//configure boot from
If you are interested in this, please scan the QR code below for free for more details
Linux/centos Nginx Installation and configuration agent