{"id":32956,"date":"2023-02-02T12:32:19","date_gmt":"2023-04-11T16:24:01","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/"},"modified":"2024-04-29T12:45:30","modified_gmt":"2024-04-29T04:45:30","slug":"%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/","title":{"rendered":"\u5728Nginx\u4e2d\u663e\u793aHTML\u7684\u65b9\u6cd5"},"content":{"rendered":"<h1>\u9996\u5148<\/h1>\n<p>\u867d\u7136\u5728Apache\u4e2d\u80fd\u591f\u6b63\u5e38\u663e\u793aHTML\uff0c\u4f46\u5728Nginx\u4e2d\u5374\u9047\u5230\u4e86\u4e00\u4e9b\u56f0\u96be\uff0c\u6240\u4ee5\u6211\u8bb0\u4e0b\u6765\u4f5c\u4e3a\u5907\u5fd8\u3002<br \/>\n\u203b\u4e5f\u89e3\u51b3\u4e86\u65e5\u8bed\u5b57\u7b26\u4e71\u7801\u7684\u95ee\u9898\u3002<\/p>\n<h1>\u89c4\u683c<\/h1>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Linux<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Amazon-linux2<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">nginx<\/ul>\n<h1>\u5b89\u88c5Nginx<\/h1>\n<pre class=\"post-pre\"><code># yum search nginx\r\nLoaded plugins: extras_suggestions, langpacks, priorities, update-motd\r\n=================================== N\/S matched: nginx ====================================\r\npcp-pmda-nginx.x86_64 : Performance Co-Pilot (PCP) metrics for the Nginx Webserver\r\n\r\n  Name and summary matches only, use \"search all\" for everything.\r\n\r\n# amazon-linux-extras list | grep nginx\r\n38  nginx1                   available    [ =stable ]\r\n\r\n# amazon-linux-extras info nginx1\r\nnginx1 recommends nginx                      # yum install nginx\r\n\r\n# sudo amazon-linux-extras install nginx1\r\n<\/code><\/pre>\n<p>\u5982\u679c\u5b89\u88c5\u5f00\u59cb\u5e76\u4e14\u987a\u5229\u5730\u5b8c\u6210\uff0c<br \/>\n\u90a3\u4e48Nginx\u7684\u5b89\u88c5\u5c31\u7b97\u5b8c\u6210\u3002<\/p>\n<h1>\u786e\u8ba4Nginx\u662f\u5426\u5df2\u542f\u52a8<\/h1>\n<pre class=\"post-pre\"><code># sudo systemctl start nginx\r\n# sudo systemctl status nginx\r\n# sudo systemctl enable nginx\r\n<\/code><\/pre>\n<p>\u5982\u679c\u80fd\u591f\u987a\u5229\u542f\u52a8\u5c31\u597d\u3002<\/p>\n<h1>HTML\u6587\u4ef6\u521b\u5efa<\/h1>\n<pre class=\"post-pre\"><code># cd \/usr\/share\/nginx\/html\r\n# sudo vi \u597d\u304d\u306a\u30d5\u30a1\u30a4\u30eb\u540d.html\r\n# sudo systemctl restart nginx\r\n<\/code><\/pre>\n<p>Nginx\u4e0eApache\u7684HTML\u6587\u4ef6\u4f4d\u7f6e\u4e0d\u540c\u3002<br \/>\n\u4f7f\u7528vi\u8fdb\u884c\u6587\u4ef6\u5185\u7f16\u8f91\u3002<br \/>\n\u7f16\u8f91\u5b8c\u6210\u540e\uff0c\u91cd\u65b0\u542f\u52a8Nginx\uff0c\u7136\u540e\u8bbf\u95ee&#8221;http:\/\/\u516c\u5171IP\/\u559c\u6b22\u7684\u6587\u4ef6\u540d.html&#8221;\u3002<\/p>\n<h1>\u5982\u679c\u65e5\u672c\u8bed\u51fa\u73b0\u4e71\u7801\u7684\u60c5\u51b5\u4e0b<\/h1>\n<p>\u5982\u679c\u521b\u5efa\u7684HTML\u6587\u4ef6\u51fa\u73b0\u4e71\u7801\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728Nginx\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\u6765\u89e3\u51b3\u95ee\u9898\u3002<br \/>\n\u203b\u300cnginx.conf\u300d\u4f4d\u4e8e\/etc\/nginx\u76ee\u5f55\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"k\">include<\/span>             <span class=\"o\">\/<\/span><span class=\"n\">etc<\/span><span class=\"o\">\/<\/span><span class=\"n\">nginx<\/span><span class=\"o\">\/<\/span><span class=\"n\">mime<\/span><span class=\"mf\">.<\/span><span class=\"n\">types<\/span><span class=\"p\">;<\/span>\r\n<span class=\"n\">default_type<\/span>        <span class=\"n\">application<\/span><span class=\"o\">\/<\/span><span class=\"n\">octet<\/span><span class=\"o\">-<\/span><span class=\"n\">stream<\/span><span class=\"p\">;<\/span>\r\n<span class=\"n\">charset<\/span> <span class=\"no\">UTF<\/span><span class=\"o\">-<\/span><span class=\"mi\">8<\/span><span class=\"p\">;<\/span>\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code># sudo systemctl restart nginx\r\n<\/code><\/pre>\n<p>\u901a\u8fc7\u91cd\u65b0\u542f\u52a8\uff0c\u89e3\u51b3\u4e86\u65e5\u8bed\u5b57\u7b26\u663e\u793a\u4e71\u7801\u7684\u95ee\u9898\uff01\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 \u867d\u7136\u5728Apache\u4e2d\u80fd\u591f\u6b63\u5e38\u663e\u793aHTML\uff0c\u4f46\u5728Nginx\u4e2d\u5374\u9047\u5230\u4e86\u4e00\u4e9b\u56f0\u96be\uff0c\u6240\u4ee5\u6211\u8bb0\u4e0b\u6765\u4f5c\u4e3a\u5907\u5fd8\u3002 \u203b\u4e5f [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-32956","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728Nginx\u4e2d\u663e\u793aHTML\u7684\u65b9\u6cd5 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nginx\u4e2d\u663e\u793ahtml\u7684\u65b9\u6cd5\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728Nginx\u4e2d\u663e\u793aHTML\u7684\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"\u9996\u5148 \u867d\u7136\u5728Apache\u4e2d\u80fd\u591f\u6b63\u5e38\u663e\u793aHTML\uff0c\u4f46\u5728Nginx\u4e2d\u5374\u9047\u5230\u4e86\u4e00\u4e9b\u56f0\u96be\uff0c\u6240\u4ee5\u6211\u8bb0\u4e0b\u6765\u4f5c\u4e3a\u5907\u5fd8\u3002 \u203b\u4e5f [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nginx\u4e2d\u663e\u793ahtml\u7684\u65b9\u6cd5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-11T16:24:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T04:45:30+00:00\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/\",\"name\":\"\u5728Nginx\u4e2d\u663e\u793aHTML\u7684\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-04-11T16:24:01+00:00\",\"dateModified\":\"2024-04-29T04:45:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728Nginx\u4e2d\u663e\u793aHTML\u7684\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728Nginx\u4e2d\u663e\u793aHTML\u7684\u65b9\u6cd5 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nginx\u4e2d\u663e\u793ahtml\u7684\u65b9\u6cd5\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728Nginx\u4e2d\u663e\u793aHTML\u7684\u65b9\u6cd5","og_description":"\u9996\u5148 \u867d\u7136\u5728Apache\u4e2d\u80fd\u591f\u6b63\u5e38\u663e\u793aHTML\uff0c\u4f46\u5728Nginx\u4e2d\u5374\u9047\u5230\u4e86\u4e00\u4e9b\u56f0\u96be\uff0c\u6240\u4ee5\u6211\u8bb0\u4e0b\u6765\u4f5c\u4e3a\u5907\u5fd8\u3002 \u203b\u4e5f [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nginx\u4e2d\u663e\u793ahtml\u7684\u65b9\u6cd5\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-04-11T16:24:01+00:00","article_modified_time":"2024-04-29T04:45:30+00:00","author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/","name":"\u5728Nginx\u4e2d\u663e\u793aHTML\u7684\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-04-11T16:24:01+00:00","dateModified":"2024-04-29T04:45:30+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728Nginx\u4e2d\u663e\u793aHTML\u7684\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e4%b8%ad%e6%98%be%e7%a4%bahtml%e7%9a%84%e6%96%b9%e6%b3%95\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/32956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=32956"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/32956\/revisions"}],"predecessor-version":[{"id":85358,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/32956\/revisions\/85358"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=32956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=32956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=32956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}