First, we're using Nginx.
Save the Domain name certificate file 1_www.domain.com_bundle.crt, the private key file 2_www.domain.com.key to the same directory, such as the/usr/local/nginx/conf directory.
In the Ngxin configuration, add the following:
server { 443; server_name www.domain.com; #填写绑定证书的域名 SSL on; Ssl_certificate 1_www.domain.com_bundle.crt; Ssl_certificate_key 2_www.domain.com.key; Ssl_session_timeout 5m; Ssl_protocols TLSv1 TLSv1. 1 TLSv1.2; #按照这个协议配置 ssl_ciphers ECDHE-rsa-aes128-gcm-sha256:high:!anull:! md5:! rc4:! DHE; #按照这个套件配置 ssl_prefer_server_ciphers on; / { root html; #站点目录 index index.html index.htm; } }
Enter Nginx Source Package reconfiguration:
./Configure--prefix=/usr/local/Nginx--with-Http_stub_status_module--with-Http_ssl_module--pid-path=/var/run/nginx/Nginx.pid--lock-path=/var/lock/Nginx.lock--error-log-path=/var/log/nginx/Error.log--http-log-path=/var/log/nginx/Access.log--with-Http_gzip_static_module--http-client-body-temp-path=/var/temp/nginx/Client--http-proxy-temp-path=/var/temp/nginx/Proxy--http-fastcgi-temp-path=/var/temp/nginx/fastcgi--http-uwsgi-temp-path=/var/temp/nginx/Uwsgi--http-scgi-temp-path=/var/temp/nginx/scgi--add-module=/home/software/fastdfs-nginx-module/src
The above is FASTDFS + SSL configuration, if you do not need to FASTDFS, then only need the following:
./--prefix=/usr/local/--with-
Make
Make Install
Ok
Use the./NGINX-T Test for success
And then reboot to access it, and the final result is as follows:
Add SSL to your website and use HTTPS for access