{"id":313,"date":"2022-11-25T15:23:30","date_gmt":"2022-11-25T07:23:30","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/wwwinfo\/313.html"},"modified":"2022-11-25T15:23:30","modified_gmt":"2022-11-25T07:23:30","slug":"nginx-%e8%87%aa%e5%8a%a8%e8%b7%b3%e8%bd%ac%e5%88%b0https-nginx%e8%ae%be%e7%bd%aehttp%e8%87%aa%e5%8a%a8%e8%b7%b3%e8%bd%achttps-ssl%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/app.applebyme.cn\/cloud\/wwwinfo\/313.html","title":{"rendered":"Nginx \u81ea\u52a8\u8df3\u8f6c\u5230HTTPS Nginx\u8bbe\u7f6ehttp\u81ea\u52a8\u8df3\u8f6chttps SSL\u914d\u7f6e"},"content":{"rendered":"<p><span class=\"wpcom_tag_link\">Nginx<\/span> \u81ea\u52a8\u8df3\u8f6c\u5230HTTPS Nginx\u8bbe\u7f6ehttp\u81ea\u52a8\u8df3\u8f6chttps SSL\u914d\u7f6e<\/p>\n<p>\u65b9\u6cd5\u4e00<\/p>\n<pre class=\"wp-block-code\"><code>rewrite ^(.*)$ https:\/\/$host$1 permanent;<\/code><\/pre>\n<p>\u65b9\u6cd5\u4e8c<\/p>\n<p>\u9002\u7528\u4e8e <a href=\"https:\/\/app.applebyme.cn\/shengcheng-111.html\">\u751f\u6210 \u7f51\u7ad9 APP<\/a>8<a href=\"https:\/\/app.applebyme.cn\/shengcheng-48.html\">app\u5f00\u53d1\u751f\u6210<\/a>0\u7aef\u53e3\u548c443 \u914d\u7f6e\u5728\u540c\u4e00\u4e2a server{}\u5185<\/p>\n<pre class=\"wp-block-code\"><code>if ($server_port = 80) {\n      rewrite ^(.*)$ https:\/\/$host$1 permanent;\n}<\/code><\/pre>\n<p>\u5176\u4ed6\u60c5\u51b5\uff0c \u7ad9\u70b9\u7ed1\u5b9a\u5f88\u591a\u57df\u540d\uff0c\u53ea\u8ba9\u67d0\u4e2a\u57df\u540d\u8df3\u8f6c:<\/p>\n<pre class=\"wp-block-code\"><code>set $redirect_https 1;\nif ($server_port = 80) {\n   set $redirect_https \"${redirect_https}2\";\n}\nif ($http_host = 'www.yourdomain.com') {\n   set $redirect_https \"${redirect_https}3\";\n}\nif ($http_host = 'yourdomain.com') {\n   set $redirect_https \"${redirect_https}3\";\n}\n\nif ($redirect_https = \"123\") {\nrewrite ^(.*)$ https:\/\/$host$1 permanent;\n}<\/code><\/pre>\n<p>\u793a\u4f8b<\/p>\n<pre class=\"wp-block-code\"><code>server {\n        listen       80;\n        server_name  www.getssl.cc;\n        rewrite ^ https:\/\/$http_host$request_uri? permanent;\n}\n\nserver {\n        listen 443;\n        ssl on;\n        ssl_certificate \/etc\/ssl\/cacert.pem;\n        ssl_certificate_key \/etc\/ssl\/privkey.pem;\n        server_name www.yourdomain.com;  \n\n        \n        server_tokens off;\n\n        location \/ {\n          \n                fastcgi_param   HTTPS               on;\n                fastcgi_param   HTTP_SCHEME         https;\n\n        }\n        \n}<\/code><\/pre>\n<div class=\"entry-copyright\">\n<p>\u7f16\u8f91\uff1a\u5a1c\u5a1c\uff0c\u5982\u82e5\u8f6c\u8f7d\uff0c\u8bf7\u6ce8\u660e\u51fa\u5904\uff1ahttps:\/\/www.yimenapp.com\/kb-yimen\/4895\/<\/p>\n<p>\u90e8\u5206\u5185\u5bb9\u6765\u81ea\u7f51\u7edc\u6295\u7a3f\uff0c\u5982\u6709\u4fb5\u6743\u8054\u7cfb\u7acb\u5220<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Nginx \u81ea\u52a8\u8df3\u8f6c\u5230HTTPS Nginx\u8bbe\u7f6ehttp\u81ea\u52a8\u8df3\u8f6chttps SSL\u914d\u7f6e<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[698,711,181,696],"class_list":["post-313","post","type-post","status-publish","format-standard","hentry","category-wwwinfo","tag-httphttps","tag-nginx","tag-ssl"],"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/comments?post=313"}],"version-history":[{"count":0,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/313\/revisions"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}