{"id":139197,"date":"2019-03-18T10:33:00","date_gmt":"2019-03-18T02:33:00","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=139197"},"modified":"2019-03-08T09:33:55","modified_gmt":"2019-03-08T01:33:55","slug":"nginx-apache-nginx","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/nginx-apache-nginx.html","title":{"rendered":"\u6848\u4f8b\uff1a\u914d\u7f6eapache\u548cnginx\u7684SSL\u52a0\u5bc6\u4f20\u8f93\u534f\u8bae"},"content":{"rendered":"
\u4e00\u3001SSI\u89e3\u91ca<\/strong><\/div>\n

SSI\u662f\u4e00\u79cd\u7c7b\u4f3c\u4e8eASP\u7684\u57fa\u4e8e\u670d\u52a1\u5668\u7684\u7f51\u9875\u5236\u4f5c\u6280\u672f\u3002\u5c06\u5185\u5bb9\u53d1\u9001\u5230\u6d4f\u89c8\u5668\u4e4b\u524d\uff0c\u53ef\u4ee5\u4f7f\u7528\u201c\u670d\u52a1\u5668\u7aef\u5305\u542b (SSI\uff09\u201d\u6307\u4ee4\u5c06\u6587\u672c\u3001\u56fe\u5f62\u6216\u5e94\u7528\u7a0b\u5e8f\u4fe1\u606f\u5305\u542b\u5230\u7f51\u9875\u4e2d\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528 SSI \u5305\u542b\u65f6\u95f4\/\u65e5\u671f\u6233\u3001\u7248\u6743\u58f0\u660e\u6216\u4f9b\u5ba2\u6237\u586b\u5199\u5e76\u8fd4\u56de\u7684\u8868\u5355\u3002\u5bf9\u4e8e\u5728\u591a\u4e2a\u6587\u4ef6\u4e2d\u91cd\u590d\u51fa\u73b0\u7684\u6587\u672c\u6216\u56fe\u5f62\uff0c\u4f7f\u7528\u5305\u542b\u6587\u4ef6\u662f\u4e00\u79cd\u7b80\u4fbf\u7684\u65b9\u6cd5\u3002\u5c06\u5185\u5bb9\u5b58\u5165\u4e00\u4e2a\u5305\u542b\u6587\u4ef6\u4e2d\u5373\u53ef\uff0c\u800c\u4e0d\u5fc5\u5c06\u5185\u5bb9\u8f93\u5165\u6240\u6709\u6587\u4ef6\u3002\u901a\u8fc7\u4e00\u4e2a\u975e\u5e38\u7b80\u5355\u7684\u8bed\u53e5\u5373\u53ef\u8c03\u7528\u5305\u542b\u6587\u4ef6\uff0c\u6b64\u8bed\u53e5\u6307\u793a Web \u670d\u52a1\u5668\u5c06\u5185\u5bb9\u63d2\u5165\u9002\u5f53\u7f51\u9875\u3002\u800c\u4e14\uff0c\u4f7f\u7528\u5305\u542b\u6587\u4ef6\u65f6\uff0c\u5bf9\u5185\u5bb9\u7684\u6240\u6709\u66f4\u6539\u53ea\u9700\u5728\u4e00\u4e2a\u5730\u65b9\u5c31\u80fd\u5b8c\u6210\u3002<\/p>\n

\u56e0\u4e3a\u5305\u542b SSI \u6307\u4ee4\u7684\u6587\u4ef6\u8981\u6c42\u7279\u6b8a\u5904\u7406\uff0c\u6240\u4ee5\u5fc5\u987b\u4e3a\u6240\u6709 SSI \u6587\u4ef6\u8d4b\u4e88 SSI\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u6269\u5c55\u540d\u662f .stm\u3001.shtm \u548c .shtml<\/p>\n

\u4e8c. apache\u914d\u7f6e<\/strong><\/div>\n
\r\n\u4fee\u6539Apache\u914d\u7f6e\u6587\u4ef6httpd.conf\r\n#\u786e\u8ba4\u52a0\u8f7dinclude.so\u6a21\u5757\uff0c\u5c06\u6ce8\u91ca\u53bb\u6389\uff1a\r\nLoadModule include_module libexec\/apache2\/mod_include.so\r\n\r\n#AddType\u90e8\u5206\u53bb\u6389\u8fd9\u4e24\u6bb5\u6ce8\u91ca\uff1a\r\nAddType text\/html .shtml\r\nAddOutputFilter INCLUDES .shtml\r\n\r\n#Directory\u76ee\u5f55\u6743\u9650\u91cc\u9762\u627e\u5230\r\nOptions Indexes FollowSymLinks\r\n#\u589e\u52a0Includes\u4fee\u6539\u4e3a\uff1a\r\nOptions Indexes FollowSymLinks Includes\r\n\u91cd\u65b0\u542f\u52a8Apache\r\napachectl server restart\r\n<\/pre>\n
\u4e8c. nginx\u914d\u7f6e\u7f6e<\/strong><\/div>\n
ssi \u6307\u4ee4<\/strong><\/span><\/div>\n
\r\n\u8bed\u6cd5\uff1assi [ on | off ]\r\n\u9ed8\u8ba4\u503c\uff1assi off\r\n\u914d\u7f6e\u6bb5\u6bb5\uff1ahttp, server, location, if\r\n\u542f\u7528SSI\u5904\u7406\u3002\r\n<\/pre>\n

\u6ce8\u610f\u5982\u679c\u542f\u7528SSI\uff0c\u90a3\u4e48Last-Modified\u5934\u548cContent-Length\u5934\u4e0d\u4f1a\u4f20\u9012\u3002<\/p>\n

ssi_silent_errors \u6307\u4ee4<\/strong><\/span><\/div>\n
\r\n\u8bed\u6cd5\uff1assi_silent_errors [on|off]\r\n\u9ed8\u8ba4\u503c\uff1assi_silent_errors off\r\n\u914d\u7f6e\u6bb5\uff1ahttp, server, location\r\n<\/pre>\n

\u5982\u679c\u5728\u5904\u7406SSI\u7684\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u201c[an error occurred while processing the directive]\u201d\u9519\u8bef\uff0c\u7981\u6b62\u5c06\u5176\u8f93\u51fa\u3002<\/p>\n

ssi_types \u6307\u4ee4<\/strong><\/span><\/div>\n
\r\n\u8bed\u6cd5\uff1assi_types mime-type [mime-type \u2026]\r\n\u9ed8\u8ba4\u503c\uff1assi_types text\/html\r\n\u914d\u7f6e\u6bb5\uff1ahttp, server, location\r\n<\/pre>\n

\u9ed8\u8ba4\u53ea\u89e3\u6790text\/html\u7c7b\u578b\uff0c\u8fd9\u4e2a\u53c2\u6570\u53ef\u4ee5\u6307\u5b9a\u5176\u4ed6\u7684MIME\u7c7b\u578b<\/p>\n

ssi_value_length<\/strong><\/span><\/div>\n
\r\n\u8bed\u6cd5\uff1assi_value_length length\r\n\u9ed8\u8ba4\u503c\uff1assi_value_length 256\r\n\u914d\u7f6e\u6bb5\uff1ahttp, server, location\r\n<\/pre>\n

\u5b9a\u4e49\u5141\u8bb8SSI\u4f7f\u7528\u7684\u53c2\u6570\u503c\u7684\u957f\u5ea6\u3002<\/p>\n

\u5728nginx\u4e0b\u505a\u5982\u4e0b\u8bbe\u7f6e,\u5728http\u6bb5\u6dfb\u52a0:<\/p>\n

\r\nssi on;\r\nssi_silent_errors off;\r\nssi_value_length 1024;\r\nssi_types text\/shtml;\r\n<\/pre>\n
\r\nlocation \/ {\r\n    ssi on;\r\n    ssi_silent_errors off;\r\n    ssi_value_length 1024;\r\n    ssi_types text\/shtml;\r\n}\r\n<\/pre>\n
\r\nlocation ~* \\.shtml$ {\r\n    ssi on;\r\n    ssi_silent_errors off;\r\n    ssi_value_length 1024;\r\n    ssi_types text\/shtml;\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

SSI\u662f\u4e00\u79cd\u7c7b\u4f3c\u4e8eASP\u7684\u57fa\u4e8e\u670d\u52a1\u5668\u7684\u7f51\u9875\u5236\u4f5c\u6280\u672f\u3002\u5c06\u5185\u5bb9\u53d1\u9001\u5230\u6d4f\u89c8\u5668\u4e4b\u524d\uff0c\u53ef\u4ee5\u4f7f\u7528\u201c\u670d\u52a1\u5668\u7aef\u5305\u542b (SSI\uff09 […]<\/p>\n","protected":false},"author":668,"featured_media":28634,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-139197","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/139197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=139197"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/139197\/revisions"}],"predecessor-version":[{"id":139274,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/139197\/revisions\/139274"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/28634"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=139197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=139197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=139197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}