全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2138|回复: 20

[疑问] 求大佬给个emby反代的教程

[复制链接]
发表于 2023-12-2 17:40:15 | 显示全部楼层 |阅读模式
就是我现在emby是搭在A机器上的,但是想访问B机器去访问A的内容,这样操作是因为A机器性能强,但线路烂,B机器性能烂,但线路好。。。。。
不要宝塔的,就nginx 或者Nginx Proxy Manager的都行
自己折腾了几个帖子,感觉都不成功,多谢大佬~
发表于 2023-12-2 19:17:38 | 显示全部楼层
  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那里自己改
发表于 2023-12-2 17:56:33 | 显示全部楼层
emby跟平时反代的网页就是加个:8096的区别,所以网上的反代教程都能通用到EMBY上,我都直接给EMBY套CF看的
 楼主| 发表于 2023-12-2 20:05:23 | 显示全部楼层

多谢大佬~我去试试
发表于 2023-12-2 20:11:56 | 显示全部楼层
宝塔设置这个很简单的。
 楼主| 发表于 2023-12-2 20:19:51 | 显示全部楼层

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
似乎有报错。。。
发表于 2023-12-2 20:24:35 | 显示全部楼层
本帖最后由 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.   }
复制代码
 楼主| 发表于 2023-12-2 20:32:55 | 显示全部楼层
piaofu998 发表于 2023-12-2 20:11
宝塔设置这个很简单的。

我再折腾下,不怎么想用宝塔这玩意
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-6 03:24 , Processed in 0.078548 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表