官术网_书友最值得收藏!

How to do it...

Now that we have a certificate and private key, we can update our NGINX configuration to serve SSL-based sites. Here's our NGINX server directive block:

server { 
    listen              443 ssl; 
    server_name         ssl.nginxcookbook.com; 
    ssl_certificate     /etc/ssl/public.pem; 
    ssl_certificate_key /etc/ssl/private.key; 
    ssl_protocols       TLSv1 TLSv1.1 TLSv1.2; 
    ssl_ciphers         HIGH:!aNULL:!MD5; 
 
    access_log  /var/log/nginx/ssl-access.log  combined; 
 
    location  /favicon.ico { access_log off; log_not_found off; } 
    root  /var/www; 
} 

If you have a basic index.html or similar in /var/www, you should see something like the following:

The error message will vary between browsers, but they're all simply letting you know that the certificate presented couldn't be validated and therefore can't be intrinsically trusted. For testing, add an exception here; you should see the SSL site served by NGINX:

主站蜘蛛池模板: 顺平县| 金昌市| 盖州市| 龙岩市| 新安县| 安阳市| 广州市| 谢通门县| 兴文县| 湖州市| 平罗县| 定南县| 乐都县| 巴东县| 博乐市| 柘荣县| 阿瓦提县| 临安市| 湄潭县| 香河县| 安徽省| 丰镇市| 榆社县| 长兴县| 吴江市| 西峡县| 永仁县| 沁源县| 安义县| 巨野县| 连平县| 柞水县| 壶关县| 米脂县| 梁河县| 枣庄市| 饶阳县| 黄平县| 许昌县| 长岭县| 宁南县|