全球主机交流论坛

标题: 求大佬给个emby反代的教程 [打印本页]

作者: licong    时间: 2023-12-2 17:40
标题: 求大佬给个emby反代的教程
就是我现在emby是搭在A机器上的,但是想访问B机器去访问A的内容,这样操作是因为A机器性能强,但线路烂,B机器性能烂,但线路好。。。。。
不要宝塔的,就nginx 或者Nginx Proxy Manager的都行
自己折腾了几个帖子,感觉都不成功,多谢大佬~
作者: 西山尘    时间: 2023-12-2 17:56
emby跟平时反代的网页就是加个:8096的区别,所以网上的反代教程都能通用到EMBY上,我都直接给EMBY套CF看的
作者: ohh    时间: 2023-12-2 18:09
帮顶
作者: 那山很优雅    时间: 2023-12-2 19:17
  1. #PROXY-START/

  2. client_max_body_size 5000M;
  3.     proxy_set_header X-Real-IP $remote_addr;
  4.     proxy_set_header X-Forwarded-For '$proxy_add_x_forwarded_for';
  5.     proxy_set_header X-Forwarded-Proto $scheme;
  6.     proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;
  7.     proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
  8.     proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;
  9.     proxy_cache off;
  10.     proxy_redirect off;
  11.     proxy_buffering off;
  12. location / {
  13.         proxy_pass http://IP:8096;
  14.         proxy_set_header X-Forwarded-For $remote_addr;
  15.         proxy_ssl_verify off;
  16.         proxy_http_version 1.1;
  17.         proxy_set_header Host $http_host;
  18.         proxy_set_header Upgrade $http_upgrade;
  19.         proxy_set_header Connection "upgrade";
  20.         proxy_read_timeout 86400;
  21.     }

  22. location ~* \.(gif|png|jpg|css|js|woff|woff2)$
  23. {
  24.     proxy_pass http://IP:8096;
  25.     proxy_set_header Host $host;
  26.     proxy_set_header X-Real-IP $remote_addr;
  27.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  28.     proxy_set_header REMOTE-HOST $remote_addr;
  29.     expires 12h;#图片缓存浏览器过期时间
  30. }

  31. #PROXY-END/
复制代码


IP那里自己改
作者: licong    时间: 2023-12-2 20:05
那山很优雅 发表于 2023-12-2 19:17
IP那里自己改

多谢大佬~我去试试
作者: piaofu998    时间: 2023-12-2 20:11
宝塔设置这个很简单的。
作者: licong    时间: 2023-12-2 20:19
那山很优雅 发表于 2023-12-2 19:17
IP那里自己改

root@debian:/etc/nginx/conf.d# nano emby.conf
root@debian:/etc/nginx/conf.d# cd
root@debian:~# nginx -t
nginx: [emerg] "location" directive is not allowed here in /etc/nginx/conf.d/emby.conf:13
nginx: configuration file /etc/nginx/nginx.conf test failed
似乎有报错。。。
作者: Parish8444    时间: 2023-12-2 20:24
本帖最后由 Parish8444 于 2023-12-2 20:26 编辑
licong 发表于 2023-12-2 20:19
root@debian:/etc/nginx/conf.d# nano emby.conf
root@debian:/etc/nginx/conf.d# cd
root@debian:~# ngi ...


你直接复制粘贴?

server {
listen 443 ssl http2;
...(一些其他的配置)
[楼上的配置]
}

这是一个示范的配置
  1.   server { # simple reverse-proxy
  2.     listen       80;
  3.     server_name  domain2.com www.domain2.com;
  4.     access_log   logs/domain2.access.log  main;

  5.     # serve static files
  6.     location ~ ^/(images|javascript|js|css|flash|media|static)/  {
  7.       root    /var/www/virtual/big.server.com/htdocs;
  8.       expires 30d;
  9.     }

  10.     # pass requests for dynamic content to rails/turbogears/zope, et al
  11.     location / {
  12.       proxy_pass      http://127.0.0.1:8080;
  13.     }
  14.   }
复制代码

作者: licong    时间: 2023-12-2 20:32
piaofu998 发表于 2023-12-2 20:11
宝塔设置这个很简单的。

我再折腾下,不怎么想用宝塔这玩意
作者: TEAMWANG    时间: 2023-12-2 20:53
马克
作者: fzl    时间: 2023-12-2 21:04
Nginx Proxy Manager的好像把ip和端口填好,然后websocket打开就行
作者: 螃蟹就得走直线    时间: 2023-12-2 21:07
我好奇你的A库多大容量?能求个sssssssvip吗?
作者: yjx79802    时间: 2023-12-2 21:20
server
    {
        listen 80;
        server_name 域名 ;
        location / {
            proxy_pass http://IP:8096;
            proxy_cache off;
            proxy_buffering off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
        access_log off;
    }
作者: Unit2411    时间: 2023-12-3 01:02

作者: okay_xm    时间: 2023-12-3 01:14
mark下,回头慢慢看
作者: daniu    时间: 2023-12-3 10:58
mark下,
作者: 大古熬成汤    时间: 2023-12-3 11:29
这种是不是只能反代主站,如果推流片源的服务器域名跟主站不一样就不太行了
作者: licong    时间: 2023-12-3 21:11
折腾了好久,发现是docker部署的emby,貌似不能反代。。。换物理机搞定了
作者: Senator    时间: 2023-12-4 03:56
绑定
作者: lisa1937    时间: 2023-12-12 22:38
B机器用gost端口转发就行了,用不着重型武器nginx乃至宝塔
A机器使用合成证书走https快的一笔
给个车位帮你几分钟搞定

https://t.me/goldn133
作者: xcdao7    时间: 2023-12-12 22:39
CDN了解下便宜量大




欢迎光临 全球主机交流论坛 (https://91ai.net/) Powered by Discuz! X3.4