{"id":139196,"date":"2019-03-16T08:31:28","date_gmt":"2019-03-16T00:31:28","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=139196"},"modified":"2019-03-08T09:32:29","modified_gmt":"2019-03-08T01:32:29","slug":"nginx-https-proxy","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/nginx-https-proxy.html","title":{"rendered":"Nginx\u914d\u7f6ehttps\u5b9e\u73b0\u52a0\u5bc6\u8ba4\u8bc1"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u5173\u4e8ehttps\u6240\u9700\u8981\u7684\u8bc1\u4e66\uff0c\u53ef\u4ee5\u5230StartSSL\u4e0a\u7533\u8bf7\uff0c\u539f\u7406\u90e8\u5206\u8bf7\u79fb\u6b65\u5c06\u7f51\u7ad9\u6253\u9020\u4e3ahttps,nginx\u7684server\u6a21\u5757\u914d\u7f6e443\u7aef\u53e3\u7684\u76d1\u542c\uff0c\u5e76\u4e14\u5c06\u8bc1\u4e66\uff0c\u79c1\u94a5\u4fe1\u606f\u4e5f\u7f57\u5217\u5b8c\u6574,nginx\u7684server\u6a21\u5757\u914d\u7f6e80\u7aef\u53e3\uff0c\u5f3a\u5236\u8df3\u8f6c\u5230https\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n HTTPS\u7684\u57fa\u672c\u539f\u7406<\/strong><\/span><\/div>\n \u516c\u94a5\u79c1\u94a5 ssh-keygen -t rsa -C \u201cnew email\u201d\u8bc1\u4e66\uff0c\u516c\u94a5\u52a0\u4e0aCA\u7684\u8ba4\u8bc1<\/p>\n CA\u662f\u9881\u53d1\u53d7\u4fe1\u4efb\u7684\u8bc1\u4e66\u7684\u673a\u6784<\/strong><\/span><\/div>\n TLS1.2\u662f\u76ee\u524d\u6700\u9ad8\u7248\u672c\uff0c\u8fd8\u6ca1\u6709\u53d1\u73b0bug\u3002\u4e0d\u8981\u9009\u62e9SSL\uff0cTLS\u662fSSL\u7684\u540e\u7eed\u7248\u672c\uff0c\u6bd4SSL\u66f4\u52a0\u5b89\u5168\u3002OpenSSL\u662f\u652f\u6301TLS\u7684\u3002<\/p>\n \u5173\u4e8e\u4e00\u7cfb\u5217\u7684RSA\u52a0\u5bc6\u89e3\u5bc6\uff0c\u5305\u62ec\u5bf9\u79f0\u52a0\u89e3\u5bc6\uff0cSHA\u6458\u8981\u7b7e\u540d\u7b49\uff0c\u6ce8\u610f\u7406\u89e3\u5176\u539f\u7406\u5373\u53ef\u3002\u5176\u4e2dSHA1\u5df2\u88ab\u5c71\u4e1c\u5927\u5b66\u7684\u738b\u5c0f\u4e91\u6559\u6388\u7834\u89e3\uff0c\u6539\u7528SHA2.<\/p>\n 302\u6d4f\u89c8\u5668\u7aef\u8df3\u8f6c\u9700\u8981\u91cd\u65b0\u8fdb\u884ctcp\u63e1\u624b<\/strong><\/span><\/div>\n \u670d\u52a1\u5668\u7aef\u53d1\u9001\u7684\u8bc1\u4e66\uff0c\u6d4f\u89c8\u5668\u9700\u8981\u5230\u5176CA\u8fdb\u884c\u9a8c\u8bc1\u662f\u5426\u53ef\u4fe1<\/p>\n \u8bc1\u4e66\u79c1\u94a5\u4e3b\u8981\u7528\u6765\u534f\u5546\u5bf9\u79f0\u52a0\u5bc6\u79d8\u94a5<\/p>\n \u7533\u8bf7\u8bc1\u4e66<\/strong><\/span><\/div>\n StartSSL\u662f\u4e00\u4e2a\u514d\u8d39\u7684\u5168\u7403\u8303\u56f4\u8ba4\u8bc1\u7684\u8bc1\u4e66\u63d0\u4f9b\u5546\u3002\u5177\u4f53\u7684\u6ce8\u518c\u4ee5\u53ca\u4f7f\u7528\u53c2\u8003\u5176\u5b98\u7f51,\u8fd9\u7bc7\u535a\u6587\u8bb2\u89e3\u5f97\u8fd8\u662f\u6bd4\u8f83\u7ec6\u81f4\u7684\u3002<\/p>\n nginx\u914d\u7f6e\u652f\u6301<\/strong><\/span><\/div>\n \r\n#redirect to https\r\nserver {\r\n listen 80;\r\n server_name blog.huachao.me;\r\n return 301 https:\/\/$server_name$request_uri;\r\n}\r\n<\/pre>\n |