The source of the matter is, the company to the website from HTTP to HTTPS, due to historical reasons, only found that the existing nginx is installed through the source code, and does not install the SSL module, need to install the SLL module, this nginx is the company's most front-end agent, involving many departments, Because it has not been done before, it is good to be careful, the following is demonstrated on the virtual machine.
1, first install some of the following required packages
Yum install gcc-c++yum install pcre pcre-devel yum install zlib zlib-devel Yum Install OpenSSL OpenSSL--devel
2, download Nginx source code
Wget-c https://
3, unzip, compile, install
TAR-ZXVF nginx-1.11. 4 . TAR.GZCD nginx-1.11. 4 . /Configuremakemake Install
4, after the installation is successful, it can be accessed in the browser, the default installation under/usr/local/nginx
5, due to the default installation, we use the command to view the modules contained in Nginx, and no SSL module
/usr/local/nginx/sbin/nginx-v
--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- ----------------------
6, here's how to install some modules after this happens, such as the SSL module
7, enter the source package, re-execute the previous module, note must not do make install, otherwise it will cover the
CD nginx-1.11. 4 . /configure--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_modulemake
8, install the module, after compiling, back up the previous nginx, in case of a contingency, and then replace the compiled Nginx
Cp/usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/bak/nginxcp. /objs/nginx/usr/local/nginx/sbin/
9, now check the Nginx installed module
Success, over, if it is installed through the RPM package, as if the default is to include these modules, if through the source installation, and forget to install some modules, you can only follow up the installation of these modules, if you have a better way, hope to criticize.
Nginx source installation and subsequent upgrade HTTPS