{"id":44565,"date":"2020-02-29T00:19:50","date_gmt":"2020-02-28T16:19:50","guid":{"rendered":"http:\/\/4563.org\/?p=44565"},"modified":"2020-02-29T00:19:50","modified_gmt":"2020-02-28T16:19:50","slug":"%e5%8f%88%e6%98%af%e5%85%b3%e4%ba%8enginx%e7%9a%84%e9%97%ae%e9%a2%98%ef%bc%8c","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=44565","title":{"rendered":"\u53c8\u662f\u5173\u4e8eNginx\u7684\u95ee\u9898\uff0c"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>\u5bb6\u6709\u81ea\u5df1\u81ea\u6e29\u6696<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:00:23\t<\/p>\n<h3>\u53c8\u662f\u5173\u4e8eNginx\u7684\u95ee\u9898\uff0c<\/h3>\n<p>  \t\tserver {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; listen 80;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; listen 443 ssl http2;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; server_name example;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; <br \/>  &nbsp; &nbsp; &nbsp; &nbsp; #ssl on;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ssl_certificate \/etc\/nginx\/ssl\/ssl.crt;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ssl_certificate_key \/etc\/nginx\/ssl\/ssl.key;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ssl_session_timeout 5m;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ssl_protocols TLSv1 TLSv1.1 TLSv1.2;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ssl_prefer_server_ciphers on;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; <br \/>  &nbsp; &nbsp; &nbsp; &nbsp; root \/var\/www\/example;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; index index.php index.html index.htm;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; if ($ssl_protocol = &quot;&quot;) { return 301 https:\/\/$host$request_uri; }<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; if ($host != example) {return 301 $scheme:\/\/example$request_uri;}<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; include \/etc\/nginx\/rewrite\/example.conf;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; <br \/>  &nbsp; &nbsp; &nbsp; &nbsp; location \/ {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try_files $uri $uri\/ =404;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; location ~ .php$ {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; include snippets\/fastcgi-php.conf;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>  }<\/p>\n<p>  \u8fd9\u662f\u6211\u7684Conf\u7684\u914d\u7f6e\uff0c\u4f46\u8f93\u5165nginx-t\u65f6\u4e00\u76f4\u63d0\u793a<\/p>\n<p>  nginx:  duplicate location &quot;\/&quot; in \/etc\/nginx\/sites-enabled\/pic:20<br \/>  nginx: configuration file \/etc\/nginx\/nginx.conf test failed<\/p>\n<p>  \u6211\u5b9e\u5728\u662f\u6ca1\u770b\u5230\u90a3\u91cc\u91cd\u590d\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Chiefs<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:02:26\t<\/p>\n<h3><\/h3>\n<p>  \t\tlisten 80;<br \/>  listen 443 ssl http2;\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5bb6\u6709\u81ea\u5df1\u81ea\u6e29\u6696<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:03:14\t<\/p>\n<h3><\/h3>\n<p>  \t\tChiefs \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:02<br \/>  listen 80;<br \/>  listen 443 ssl http2;<\/p>\n<p> yc014t\u8fd9\u4e2a\u5730\u65b9\u6709\u6bdb\u75c5\uff1f\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>yywudi<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:04:14\t<\/p>\n<h3><\/h3>\n<p>  \t\tinclude \/etc\/nginx\/rewrite\/example.conf<\/p>\n<p>  \u770b\u770b\u4f60include\u7684\u6587\u4ef6\u91cc\u9762\u662f\u4e0d\u662f\u4e5f\u6709 location \/<br \/>  \u6216\u8005\u4f60\u628a\u8fd9\u884c\u6ce8\u91ca\u4e86\u770b nginx -t \u8fd8\u62a5\u9519\u4e48\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Chiefs<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:04:16\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4e00\u4e2aserver\u76d1\u542c\u4e00\u4e2a\u7aef\u53e3\uff0c\u6211\u6ca1\u770b\u8fc7\u6587\u6863\uff0c\u4f46\u57fa\u672c\u4e0a\u6211\u731c\u7684\u662f\u5bf9\u7684\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5bb6\u6709\u81ea\u5df1\u81ea\u6e29\u6696<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:05:42\t<\/p>\n<h3><\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 \u5bb6\u6709\u81ea\u5df1\u81ea\u6e29\u6696 \u4e8e 2019-11-30 17:07 \u7f16\u8f91 <\/p>\n<p> yywudi \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:04<br \/>  include \/etc\/nginx\/rewrite\/example.conf<\/p>\n<p>  \u770b\u770b\u4f60include\u7684\u6587\u4ef6\u91cc\u9762\u662f\u4e0d\u662f\u4e5f\u6709 location \/<\/p>\n<p>  \u8c22\u8c22\u5927\u4f6c \u5c31\u662f<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; location \/ {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try_files $uri $uri\/ =404;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n<p>  \u8fd9\u91cc\u91cd\u590d\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5bb6\u6709\u81ea\u5df1\u81ea\u6e29\u6696<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:06:44\t<\/p>\n<h3><\/h3>\n<p>  \t\tChiefs \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:04<br \/>  \u4e00\u4e2aserver\u76d1\u542c\u4e00\u4e2a\u7aef\u53e3\uff0c\u6211\u6ca1\u770b\u8fc7\u6587\u6863\uff0c\u4f46\u57fa\u672c\u4e0a\u6211\u731c\u7684\u662f\u5bf9\u7684<\/p>\n<p> yc014t\u4f60\u731c\u9519\u4e86\uff0cserver\u53ef\u4ee5\u540c\u65f6\u76d1\u542c80\u548c443\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Chiefs<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:07:37\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5bb6\u6709\u81ea\u5df1\u81ea\u6e29\u6696 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:06<br \/>  \u4f60\u731c\u9519\u4e86\uff0cserver\u53ef\u4ee5\u540c\u65f6\u76d1\u542c80\u548c443<\/p>\n<p> \u597d\u5427\u6211\u8ba4\u9519:lol \uff0c\u53ef\u80fd\u662f2\u4e2a\u6587\u4ef6\u91cc\u786e\u5b9e\u90fd\u51fa\u73b0\u4e86 \/\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5bb6\u6709\u81ea\u5df1\u81ea\u6e29\u6696<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:08:17\t<\/p>\n<h3><\/h3>\n<p>  \t\tChiefs \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-11-30 17:07<br \/>  \u597d\u5427\u6211\u8ba4\u9519 \uff0c\u53ef\u80fd\u662f2\u4e2a\u6587\u4ef6\u91cc\u786e\u5b9e\u90fd\u51fa\u73b0\u4e86 \/<\/p>\n<p> yc014t\u662f\u7684\uff0c\u4f2a\u9759\u6001\u91cc\u6709\u4e86\u4e00\u4e2a\uff0c\u6211\u53c8\u91cd\u65b0\u5199\u4e86\u4e00\u904d\u3002\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bb6\u6709\u81ea\u5df1\u81ea\u6e29\u6696 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/44565"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=44565"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/44565\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=44565"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=44565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}