{"id":141,"date":"2021-06-16T04:31:00","date_gmt":"2021-06-16T04:31:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=141"},"modified":"2021-06-16T04:31:00","modified_gmt":"2021-06-16T04:31:00","slug":"141","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2021\/06\/16\/141\/","title":{"rendered":"\u79c1\u4eba\u4e91\u76d8\u642d\u5efa\u4e4b Nginx  https\u4ee3\u7406 Emby \u7f51\u7edc\u89c6\u9891\u64ad\u653e"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/06\/1343102762.jpg\" alt=\"Cloud.jpg\" title=\"Cloud.jpg\"><\/p>\n<p>Emby\uff08\u539f\u540dMedia Browser\uff09\u662f\u4e00\u4e2a\u4e3b\u4ece\u5f0f\u67b6\u6784\u7684\u5a92\u4f53\u670d\u52a1\u5668\u8f6f\u4ef6\uff0c\u53ef\u4ee5\u7528\u6765\u6574\u7406\u670d\u52a1\u5668\u4e0a\u7684\u89c6\u9891\u548c\u97f3\u9891\uff0c\u5e76\u5c06\u97f3\u9891\u548c\u89c6\u9891\u6d41\u5f0f\u4f20\u8f93\u5230\u5ba2\u6237\u7aef\u8bbe\u5907\u3002<\/p>\n<p>Emby\u670d\u52a1\u5668\u7aef\u652f\u6301Microsoft Windows\u3001Linux\u3001MacOS\u3001FreeBSD\uff0c\u5ba2\u6237\u7aef\u652f\u6301HTML5\u7f51\u9875\uff0cAndroid\u548cIOS\u7b49\u79fb\u52a8\u64cd\u4f5c\u7cfb\u7edf\uff0cRoku\u3001Amazon Fire TV\u3001Chromecast\u548cApple TV\u7b49\u6d41\u5a92\u4f53\u8bbe\u5907\uff0cLG\u667a\u80fd\u7535\u89c6\u548c\u4e09\u661f\u667a\u80fd\u7535\u89c6\u7b49\u667a\u80fd\u7535\u89c6\uff0c\u4ee5\u53caXbox 360\u548cXbox One\u7b49\u6e38\u620f\u673a\u3002<\/p>\n<h3>Emby \u7f51\u7edc\u89c6\u9891\u64ad\u653e \u642d\u5efa<\/h3>\n<pre><code>docker run -d \\r\n  --name=emby \\r\n  -e PUID=1000 \\r\n  -e PGID=1000 \\r\n  -p 8096:8096 \\r\n  -v \/mnt\/emby:\/config \\r\n  -v \/mnt\/downloads:\/data\/movies \\r\n  --restart unless-stopped \\r\n  emby\/embyserver<\/code><\/pre>\n<h3>\u5f71\u89c6\u4e0b\u8f7d\u8f6f\u4ef6: <a href=\"https:\/\/www.lyvba.com\/index.php\/archives\/112\/\">qbittorrent \u5b89\u88c5<\/a><\/h3>\n<ul>\n<li>\n<p>\u53c2\u8003\u6587\u7ae0  <a href=\"https:\/\/www.lyvba.com\/index.php\/archives\/112\/\">\u611f\u8c22\u5927\u795eTaterLi\u521b\u4f5cgoseeder\u81ea\u52a8PT\u5de5\u5177<\/a><\/p>\n<pre><code>wget git.io\/autopt.sh &amp;&amp; bash autopt.sh\n\n# \u7fa4\u6656NAS\u4f7f\u7528\u5982\u679c\u4e0d\u80fd\u8bbf\u95ee\u5916\u7f51 \u4f7f\u7528\u547d\u4ee4\nwget lyvba.com\/autopt.sh &amp;&amp; bash autopt.sh<\/code><\/pre>\n<\/li>\n<\/ul>\n<h1>\u5b89\u88c5Nginx \u4ee3\u7406 Emby \u7f51\u7edc\u89c6\u9891\u64ad\u653e<\/h1>\n<h3>\u542f\u52a8 nginx-php-fpm7.3 \u5bb9\u5668<\/h3>\n<pre><code>docker run -d -p 80:80 -p 443:443  \\r\n    --cpus 0.8   --restart=always   \\r\n    -v \/var\/www\/html:\/var\/www\/html   \\r\n    --name  nginx-php      \\r\n    hongwenjun\/nginx-php<\/code><\/pre>\n<h3>Nginx \u53cd\u4ee3\u7406 Emby \u7f51\u9875<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/06\/3713541364.png\" alt=\"https.png\" title=\"https.png\"><\/p>\n<ul>\n<li>\n<p>\u5982\u56fe\uff0c\u64cd\u4f5c\u547d\u4ee4<\/p>\n<pre><code>cd \/var\/www\/html\nvim https.conf   # \u7c98\u8d34\u4e0b\u9762\u914d\u7f6e\n\n# \u68c0\u67e5 Emby\u670d\u52a1\u7684\u7aef\u53e3\u548c\u5185\u7f51\niptables -L | grep 8096\n\n# \u8fdb\u5165\u5bb9\u5668\u914d\u7f6e \u4fee\u6539Nginx\u914d\u7f6e\ndocker exec -it nginx-php bash\n\ncd \/etc\/nginx\/sites-enabled\/\nls\ncp \/var\/www\/html\/https.conf default\nnginx  -t\nnginx -s reload\n<\/code><\/pre>\n<p>\u7f51\u9875\u8bbf\u95ee  <a href=\"http:\/\/188.188.188.188\/emby\">http:\/\/188.188.188.188\/emby<\/a> \u5b8c\u6210 emby \u914d\u7f6e<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/06\/2473204733.png\" alt=\"emby.png\" title=\"emby.png\"><\/p>\n<ul>\n<li>\n<p>\u6d4b\u8bd5\u7528 https.conf \u914d\u7f6e\u53c2\u8003<\/p>\n<pre><code>server {\n      listen 80 default_server;\n      listen [::]:80 default_server;\n\n      # listen 443 ssl default_server;\n      # listen [::]:443 ssl default_server;\n\n      root \/var\/www\/html;\n      index index.html index.php index.nginx-debian.html;\n      server_name _;\n\n      location \/ {\n              try_files $uri $uri\/ =404;\n      }\n\n  location \/emby\/ {\n      # Proxy main Jellyfin traffic\n      proxy_pass http:\/\/172.17.0.3:8096;\n      proxy_set_header Host $host;\n      proxy_set_header X-Real-IP $remote_addr;\n      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n      proxy_set_header X-Forwarded-Proto $scheme;\n      proxy_set_header X-Forwarded-Protocol $scheme;\n      proxy_set_header X-Forwarded-Host $http_host;\n\n      # Disable buffering when the nginx proxy gets very resource heavy upon streaming\n      proxy_buffering off;\n  }\n\n      # pass PHP scripts to FastCGI server\n      location ~ .*.php(\/.*)*$ {\n              include snippets\/fastcgi-php.conf;\n      #       # With php-fpm (or other unix sockets):\n              fastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;\n      }\n\n}<\/code><\/pre>\n<h2>\u7533\u8bf7\u57df\u540d\u548c\u83b7\u5f97\u514d\u8d39\u8bc1\u4e66\uff0c\u8bf7\u81ea\u884c google<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/06\/4156742402.png\" alt=\"m.26235.png\" title=\"m.26235.png\"><\/p>\n<h2>\u7f51\u7ad9\u542f\u7528 SSL \u4f7f\u7528 Https \u8bbf\u95ee\uff0c\u6d4f\u89c8\u5668\u4e0d\u4f1a\u4e0d\u5b89\u5168\u8b66\u544a<\/h2>\n<\/li>\n<li>\n<p>SSL\u8bc1\u4e66\u542f\u7528 https.conf \u914d\u7f6e\u53c2\u8003\uff0c\u8bf7\u5728\u672c\u5730\u7f16\u8f91\u597d\uff0c\u4f7f\u7528scp\u4e0a\u4f20<\/p>\n<pre><code>server {\n\n listen 443 ssl default_server;\n listen [::]:443 ssl default_server;\n\n server_name m.lyvba.com;\n ssl_certificate m.lyvba.com.crt;\n ssl_certificate_key m.lyvba.com.key;\n\n ssl_session_timeout 5m;\n ssl_protocols TLSv1 TLSv1.1 TLSv1.2;\n\n ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;\n ssl_prefer_server_ciphers on;\n\n root \/var\/www\/html;\n index index.html index.php index.nginx-debian.html;\n\n location \/ {\n   try_files $uri $uri\/ =404;\n   }\n\n location \/emby\/ {\n   proxy_pass http:\/\/172.17.0.3:8096;\n   proxy_set_header Host $host;\n   proxy_set_header X-Real-IP $remote_addr;\n   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n   proxy_set_header X-Forwarded-Proto $scheme;\n   proxy_set_header X-Forwarded-Protocol $scheme;\n   proxy_set_header X-Forwarded-Host $http_host;\n\n   # Disable buffering when the nginx proxy gets very resource heavy upon streaming\n   proxy_buffering off;\n   }\n\n   # pass PHP scripts to FastCGI server\n   location ~ .*.php(\/.*)*$ {\n   include snippets\/fastcgi-php.conf;\n   # fastcgi_pass 127.0.0.1:9000;\n   # With php-fpm (or other unix sockets):\n   fastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;\n }\n\n}\n\nserver {\n   listen 80;\n   server_name m.lyvba.com;\n   return 301 https:\/\/$host$request_uri;\n}<\/code><\/pre>\n<\/li>\n<li>\n<p>\u4f7f\u7528scp\u5de5\u5177\u4e0a\u4f20 \u8bc1\u4e66\u548c https\u914d\u7f6e\uff0c\u547d\u4ee4\u884c\u53c2\u8003<\/p>\n<pre><code># \u4e0a\u4f20\u8bc1\u4e66 \u5230 \u7528\u6237 root \u76ee\u5f55\u4e0b\nscp m.lyvba.com.crt root@m.lyvba.com:\/root\/.\nscp m.lyvba.com.key root@m.lyvba.com:\/root\/.\nscp https.conf       root@m.lyvba.com:\/root\/.<\/code><\/pre>\n<\/li>\n<li>\n<p>\u628a\u914d\u7f6e\u590d\u5236\u5230\u5bb9\u5668 nginx-php \u4e2d\uff0c\u542f\u7528\u914d\u7f6e<\/p>\n<pre><code>docker ps -a\ndocker cp m.lyvba.com.crt nginx-php:\/etc\/nginx\/.\ndocker cp m.lyvba.com.key nginx-php:\/etc\/nginx\/.\ndocker cp https.conf       nginx-php:\/etc\/nginx\/conf.d\/.\n\ndocker restart nginx-php\ndocker logs  nginx-php\n\n# \u5982\u679c\u542f\u52a8\u6709\u9519\u8bef\uff0c\u53ef\u4ee5\u8fdb\u5165\u5bb9\u5668\u68c0\u67e5\uff0c\u8fd8\u6709\u4e5f\u53ef\u4ee5\u5220\u9664 \/etc\/nginx\/sites-enabled\/default<\/code><\/pre>\n<\/li>\n<li>\n<p>\u7f16\u8f91\u4e3b\u9875:   vim \/var\/www\/html\/index.html<\/p>\n<pre><code>&lt;!DOCTYPE html&gt;&lt;html lang=\"en\"&gt;&lt;head&gt;&lt;meta charset=\"utf-8\" \/&gt;&lt;title&gt;\u79c1\u4eba\u4e91\u76d8:\u7f51\u7edc\u89c6\u9891\u64ad\u653e&lt;\/title&gt;\n&lt;html&gt;&lt;body style=\"text-align:center;\"&gt;\n&lt;a href=\"https:\/\/m.lyvba.com\/emby\"&gt;&lt;img src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/06\/1343102762.jpg\" &gt;&lt;\/img&gt;&lt;\/a&gt;&lt;bar&gt;\n\u70b9\u51fb\u56fe\u7247\u8fdb\u5165&lt;bar&gt;\n&lt;p&gt;&lt;p&gt;&lt;p&gt;\n\u53c2\u8003\u6587\u7ae0: &lt;a href=\"https:\/\/lyvba.com\/index.php\/archives\/141\/\"&gt;\u79c1\u4eba\u4e91\u76d8\u642d\u5efa\u4e4b Nginx https\u4ee3\u7406 Emby \u7f51\u7edc\u89c6\u9891\u64ad\u653e&lt;a&gt;&lt;bar&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Emby\uff08\u539f\u540dMedia Browser\uff09\u662f\u4e00\u4e2a\u4e3b\u4ece\u5f0f\u67b6\u6784\u7684\u5a92\u4f53\u670d\u52a1\u5668\u8f6f\u4ef6\uff0c\u53ef\u4ee5\u7528\u6765\u6574\u7406\u670d\u52a1\u5668\u4e0a\u7684\u89c6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8],"tags":[15,35,29],"class_list":["post-141","post","type-post","status-publish","format-standard","hentry","category-docker","category-linux","tag-docker","tag-nginx","tag-29"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=141"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/141\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}