Nginx配置HTTPS


一、Web服務器安裝Nginx

1、下載Nginx
https://nginx.org/download/nginx-1.9.4.tar.gz
2、安裝依賴
[root@web ~]# yum -y install pcre pcre-devel zlib zlib-devel
[root@web ~]# yum -y install gcc gcc-c++
[root@web ~]# yum install -y openssl openssl-devel
3、安裝nginx
[root@web ~]# tar -zxvf nginx-1.9.4.tar.gz
[root@web ~]# cd nginx-1.9.4
[root@web nginx-1.19.4]# ./configure --prefix=/usr/local/nginx --with-http_ssl_module && make && make install
3、編輯nginx配置文件啟用https
[root@web ~]# vim /usr/local/nginx/conf/nginx.conf

 

4、復制證書文件到 /usr/local/nginx/conf/目錄

[root@web ~]# cp web.* /usr/local/nginx/conf/

5、修改nginx配置文件證書名稱

 

 6、啟動nginx

[root@web ~]# /usr/local/nginx/sbin/nginx

7、訪問驗證

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM