Add SSL to your website and use HTTPS for access

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.