- NGINX Cookbook
- Tim Butler
- 119字
- 2021-07-03 00:04:33
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:

推薦閱讀
- 手機安全和可信應用開發指南:TrustZone與OP-TEE技術詳解
- 深入理解Android(卷I)
- Learning ROS for Robotics Programming(Second Edition)
- PostgreSQL Cookbook
- C語言程序設計基礎與實驗指導
- C語言程序設計實訓教程
- PHP 編程從入門到實踐
- Podman實戰
- Building a Quadcopter with Arduino
- 精通網絡視頻核心開發技術
- 硅谷Python工程師面試指南:數據結構、算法與系統設計
- 快速入門與進階:Creo 4·0全實例精講
- .NET Standard 2.0 Cookbook
- Unity 2018 Augmented Reality Projects
- GitHub入門與實踐