{"id":548079,"date":"2021-12-16T09:37:25","date_gmt":"2021-12-16T01:37:25","guid":{"rendered":"http:\/\/4563.org\/?p=548079"},"modified":"2021-12-16T09:37:25","modified_gmt":"2021-12-16T01:37:25","slug":"%e3%80%8c%e5%ae%9d%e5%a1%94nginx%e3%80%8d%e4%bd%bf%e7%94%a8nginx%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86%e5%8a%a0%e9%80%9fplex%e6%b5%81%e5%aa%92%e4%bd%93","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=548079","title":{"rendered":"\u300c\u5b9d\u5854Nginx\u300d\u4f7f\u7528Nginx\u53cd\u5411\u4ee3\u7406\u52a0\u901fPlex\u6d41\u5a92\u4f53"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>Meocat<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-12-1 19:18:20\t<\/p>\n<h3>\u300c\u5b9d\u5854Nginx\u300d\u4f7f\u7528Nginx\u53cd\u5411\u4ee3\u7406\u52a0\u901fPlex\u6d41\u5a92\u4f53<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 Meocat \u4e8e 2021-12-4 16:51 \u7f16\u8f91 <\/p>\n<p> \u9002\u7528\u4e8e\u6709\u4e00\u53f0\u6027\u80fd\u9e21\u4e0e\u4e00\u4e2a\u53cd\u4ee3\u673a\u7684\u60c5\u51b5<br \/>  \u6027\u80fd\u9e21\u8d1f\u8d23\u89e3\u7801\u548c\u8f6c\u7801\uff0c\u53cd\u4ee3\u673a\u5219\u901a\u8fc7\u53cb\u597d\u7684\u7ebf\u8def\u4f20\u8f93\u7ed9\u4f60<br \/>  \u6211\u672c\u4eba\u662f\u7528\u7eff\u4e918\u6838\u7684\u673a\u5668\u505a\u8f6f\u89e3\uff0c\u7136\u540e\u901a\u8fc7\u65af\u5df4\u8fbe\u8fdb\u884c\u4e8c\u6b21\u53cd\u4ee3<br \/>  \u56fe\u6587\u7248\u8bf7\u67e5\u770b https:\/\/www.hfdem.net\/plex_with_nginx\/ \u6211\u672c\u4eba\u6c34\u5e73\u4e5f\u4e0d\u9ad8 \u8bf7\u5927\u5bb6\u591a\u63d0\u610f\u89c1<br \/>  1\u30012\u8282\u8bb2Plex\u548c\u5b9d\u5854\u7684\u5b89\u88c5\uff1b3\u30014\u8282\u8bb2Nginx\u53cd\u4ee3\u548c\u9762\u677f\u8bbe\u7f6e\u7684\u7ec6\u8282 \u8fd9\u91cc\u53ea\u590d\u5236\u4e86\u7b2c\u4e09\u56db\u8282\u7684\u6587\u672c\u90e8\u5206<br \/>  \u5982\u679c\u5df2\u7ecf\u6709plex\u548c\u5b9d\u5854\u7684\u73af\u5883\uff0c\u53ef\u4ee5\u76f4\u63a5\u770b3\u30014\u8282\u5173\u4e8e\u53cd\u4ee3\u7684\u8bbe\u7f6e<\/p>\n<p>  3 \u5b9d\u5854Nginx\u53cd\u4ee3<\/p>\n<p>  \u73af\u5883\uff1a<\/p>\n<p>  \u4e00\u4e2a\u6027\u80fd\u597d\u7684VPS\u88c5Plex\u8fdb\u884c\u89e3\u7801\u5e76\u88c5\u5b9d\u5854\u8fdb\u884c\u521d\u6b65\u53cd\u4ee3\uff0c\u4ee3\u53f7VPS-1<\/p>\n<p>  \u4e00\u4e2a\u7ebf\u8def\u53cb\u597d\u7684VPS\u88c5\u5b9d\u5854\u4f5c\u4e3a\u524d\u7aef\u7528\u6765\u4e8c\u6b21\u53cd\u4ee3\uff0c\u4ee3\u53f7VPS-2<\/p>\n<p>  \u4e00\u4e2a\u57df\u540d\u5982plex.hfdem.net\u6307\u5411VPS-2\u7684IP<br \/>  3.1 VPS-1\u5b9d\u5854Nginx\u8bbe\u7f6e<\/p>\n<p>  \u7f51\u7ad9-\u6dfb\u52a0\u7ad9\u70b9 \u57df\u540d\u4e3a\u6307\u5411VPS-2\u7684\u57df\u540dplex.hfdem.net<\/p>\n<p>  \u5728\u8be5\u7ad9\u70b9\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u5220\u9664\u5bf9css\u7b49\u7684\u7f13\u5b58\uff0c\u6dfb\u52a0\u5982\u4e0b\u5b57\u6bb5\u5e76\u4fdd\u5b58\uff1a<\/p>\n<p>  &nbsp; &nbsp; client_max_body_size 5000M;<br \/>  &nbsp; &nbsp; proxy_set_header X-Real-IP $remote_addr;<br \/>  &nbsp; &nbsp; proxy_set_header X-Forwarded-For &#8216;$proxy_add_x_forwarded_for&#8217;;<br \/>  &nbsp; &nbsp; proxy_set_header X-Forwarded-Proto $scheme;<br \/>  &nbsp; &nbsp; proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;<br \/>  &nbsp; &nbsp; proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;<br \/>  &nbsp; &nbsp; proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;<br \/>  &nbsp; &nbsp; proxy_cache off;<br \/>  &nbsp; &nbsp; proxy_redirect off;<br \/>  &nbsp; &nbsp; proxy_buffering off;<br \/>  &nbsp; &nbsp; location \/ {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_pass http:\/\/127.0.0.1:32400\/;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header X-Forwarded-For $remote_addr;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_ssl_verify off;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_http_version 1.1;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header Host $http_host;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header Upgrade $http_upgrade;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header Connection &quot;upgrade&quot;;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_read_timeout 86400;<br \/>  &nbsp; &nbsp; }<\/p>\n<p>  3.2 VPS-2\u5b9d\u5854Nginx\u8bbe\u7f6e<\/p>\n<p>  \u7f51\u7ad9-\u6dfb\u52a0\u7ad9\u70b9 \u57df\u540d\u4e3a\u6307\u5411VPS-2\u7684\u57df\u540dplex.hfdem.net<br \/>  3.2.1 \u4fee\u6539hosts<\/p>\n<p>  SSH\u8fde\u63a5\u5230VPS-2\uff0c\u4f7f\u7528\u4f60\u60ef\u7528\u7684\u7f16\u8f91\u5668\u6253\u5f00\/etc\/hosts\u5e76\u6dfb\u52a0<\/p>\n<p>  VPS-1\u7684IP plex.hfdem.net <\/p>\n<p>  3.2.2 \u914d\u7f6eSSL<\/p>\n<p>  \u4e3a\u4e86\u907f\u514d\u7248\u6743\u95ee\u9898\uff0c\u5efa\u8bae\u5bf9\u6d41\u91cf\u8fdb\u884cSSL\u52a0\u5bc6<\/p>\n<p>  \u5b9d\u5854\u8981\u6c42\u5728\u914d\u7f6e\u53cd\u4ee3\u524d\u5148\u914d\u7f6eSSL\uff0c\u8bbe\u7f6e-SSL-Let\u2019s Encrypt-\u7533\u8bf7<\/p>\n<p>  \u6210\u529f\u540e\u4e5f\u8981\u590d\u5236\u5bc6\u94a5(KEY)\u4e0e\u8bc1\u4e66(PEM\u683c\u5f0f)\u5230VPS-1\u7684SSL\u4e2d\uff0c\u8bbe\u7f6e-SSL-\u5176\u4ed6\u8bc1\u4e66-\u7c98\u8d34-\u4fdd\u5b58<\/p>\n<p>  \u4e24\u8fb9\u90fd\u5efa\u8bae\u6253\u5f00\u53f3\u4e0a\u89d2\u7684\u7684\u5f3a\u5236HTTPS<br \/>  3.2.3 \u914d\u7f6e\u53cd\u5411\u4ee3\u7406<\/p>\n<p>  \u5728\u8be5\u7ad9\u70b9\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u5220\u9664\u5bf9css\u7b49\u7684\u7f13\u5b58\uff0c\u6dfb\u52a0\u5982\u4e0b\u5b57\u6bb5\u5e76\u4fdd\u5b58\uff08\u8bf7\u81ea\u884c\u4fee\u6539\u57df\u540d\uff09\uff1a<\/p>\n<p>  &nbsp; &nbsp; client_max_body_size 5000M;<br \/>  &nbsp; &nbsp; proxy_set_header X-Real-IP $remote_addr;<br \/>  &nbsp; &nbsp; proxy_set_header X-Forwarded-For &#8216;$proxy_add_x_forwarded_for&#8217;;<br \/>  &nbsp; &nbsp; proxy_set_header X-Forwarded-Proto $scheme;<br \/>  &nbsp; &nbsp; proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;<br \/>  &nbsp; &nbsp; proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;<br \/>  &nbsp; &nbsp; proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;<br \/>  &nbsp; &nbsp; proxy_cache off;<br \/>  &nbsp; &nbsp; proxy_redirect off;<br \/>  &nbsp; &nbsp; proxy_buffering off;<br \/>  &nbsp; &nbsp; location \/ {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_pass https:\/\/plex.hfdem.net\/;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header X-Forwarded-For $remote_addr;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_ssl_verify off;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_http_version 1.1;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header Host plex.hfdem.net;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header Upgrade $http_upgrade;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header Connection &quot;upgrade&quot;;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;proxy_read_timeout 86400;<br \/>  &nbsp; &nbsp; }<\/p>\n<p>  \u5b9d\u5854\u53cd\u4ee3\u5b8c\u6210\uff0c\u6253\u5f00\u4f60\u7684\u57df\u540d\u770b\u770b\u80fd\u5426\u8fdb\u5165Plex\u7684\u9762\u677f\uff0c\u5982\u679c\u4e00\u5207\u6b63\u5e38\u4e0b\u9762\u5f00\u59cbPlex\u9762\u677f\u7684\u8bbe\u7f6e<br \/>  4 Plex\u9762\u677f\u8bbe\u7f6e<\/p>\n<p>  \u5982\u679c\u53cd\u4ee3\u6b63\u5e38\uff0c\u90a3\u4e48\u4ece\u53cd\u4ee3\u7684\u9762\u677f\u7f51\u5740\u8fdb\u5165\u7684\u6d41\u91cf\u5c06\u4f1a\u7ecf\u8fc7VPS-2\u7684\u4e2d\u8f6c\u5e76\u5230\u8fbeVPS-1<\/p>\n<p>  \u4f46\u662f\u5728\u4f7f\u7528app.plex.tv\u6216APP\u7b49\u5ba2\u6237\u7aef\u65f6\u7684\u6d41\u91cf\u8fd8\u4f1a\u76f4\u8fde\u5230VPS-1<\/p>\n<p>  \u5982\u679c\u5e0c\u671b\u5ba2\u6237\u7aef\u4e5f\u80fd\u88ab\u4e2d\u8f6c\uff0c\u9700\u8981\u5728\u9762\u677f\u4e2d\u8fdb\u884c\u5982\u4e0b\u8bbe\u7f6e<\/p>\n<p>  \u8bbe\u7f6e-\u7f51\u7edc<\/p>\n<p>  &nbsp; &nbsp; \u53d6\u6d88\u52fe\u9009\u201c\u542f\u7528\u4e2d\u8f6c\u201d<\/p>\n<p>  &nbsp; &nbsp; \u81ea\u5b9a\u4e49\u670d\u52a1\u5668\u8bbf\u95eeURL\u6dfb\u52a0 https:\/\/yourdomain:443<\/p>\n<p>  \u8bbe\u7f6e-\u8fdc\u7a0b\u8bbf\u95ee<\/p>\n<p>  \u7981\u7528\u8fdc\u7a0b\u8bbf\u95ee<\/p>\n<p>  \u8bbe\u7f6e\u5b8c\u6bd5\uff0c\u81f3\u6b64\u6240\u6709\u6d41\u91cf\u90fd\u5c06\u7ecf\u8fc7VPS-2\u7684\u4e2d\u8f6c\u5230\u8fbeVPS-1<\/p>\n<p>  \u53ef\u5728Web\u7aef\u64ad\u653e\u89c6\u9891\u65f6\u6253\u5f00f12\u5f00\u53d1\u8005\u5de5\u5177-\u7f51\u7edc\uff0c\u67e5\u770b\u5a92\u4f53\u6587\u4ef6\u7684\u94fe\u63a5\u662f\u5426\u6765\u81ea\u4e8e\u4f60\u7684\u57df\u540d<\/p>\n<p>  \u6216\u8005\u5728\u64ad\u653e\u89c6\u9891\u65f6\u6253\u5f00VPS-2\u7684\u5b9d\u5854\u9762\u677f\u67e5\u770b\u6d41\u91cf\u53d8\u5316https:\/\/cdn.jsdelivr.net\/gh\/hishis\/forum-master\/public\/images\/patch.gif\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>mgwx<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-12-1 19:21:22\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u652f\u6301 \u6211\u4eca\u5929\u521a\u5427plex\u5378\u8f7d \u5361\u6b7b\u6211\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>ggk<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-12-1 19:23:36\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u652f\u6301\uff01\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>weixiangnan<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-12-1 19:31:32\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u652f\u6301\u4e0b\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Meocat<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-12-1 19:54:47\t<\/p>\n<h3><\/h3>\n<p>  \t\tmgwx \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-12-1 19:21<br \/>  \u652f\u6301 \u6211\u4eca\u5929\u521a\u5427plex\u5378\u8f7d \u5361\u6b7b\u6211\u4e86<\/p>\n<p> \u64ad\u653e\u65f6Plex\u670d\u52a1\u7aefCPU\u5360\u7528\u592a\u9ad8\uff0c\u64ad\u653e\u4e0d\u987a\u7545<\/p>\n<p>  \u8bf4\u660e\u642d\u5efaPlex\u670d\u52a1\u7aef\u7684\u673a\u5668CPU\u592a\u5f31\uff0c\u65e0\u6cd5\u9002\u5e94\u8f6f\u89e3\u7684\u6027\u80fd\u9700\u8981\uff0c\u5efa\u8baeIntel E5\u56db\u6838\u4ee5\u4e0a\uff0cAMD\u4e24\u6838\u4ee5\u4e0a<\/p>\n<p>  \u6216\u8005\u5728\u8bbe\u7f6e\u2013\u8f6c\u7801\u5668\u91cc\u9009\u4e2d\u201c\u7981\u7528\u89c6\u9891\u6d41\u8f6c\u7801\u201d\uff0c\u4f46\u8fd9\u4f1a\u5f71\u54cdweb\u7aef\u548c\u67d0\u4e9b\u5ba2\u6237\u7aef\u7684\u64ad\u653e\uff0c\u4e0d\u63a8\u8350https:\/\/cdn.jsdelivr.net\/gh\/hishis\/forum-master\/public\/images\/patch.gif\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Meocat \u5927\u4f6c\u6709\u8bdd\u8bf4 : 20&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/548079"}],"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=548079"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/548079\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=548079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=548079"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=548079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}