How does the client use the domain name to connect directly to the PMS?

关闭plex服务器的远程访问,用nginx一类的软件反代plex(用http,而非https),在plex服务器的设置界面
自定义服务器访问 URL
填入你的plex的自定义域名。
在plex服务器所在的网络里面,将 “plex.tv”加入翻墙名单,服务器向plex.tv宣告你的服务器地址时,仅会用你自己填写的域名。

这样操作后,你的客户端会忽略掉 *.plex.direct ,仅用你的自定义域名访问你的plex服务器。

客户端之类的都有登陆缓存信息,如果在外面没翻墙环境,会显示为离线模式,但是不影响使用。
如果是第一次登陆,则翻墙登陆一次即可。

实际上,很年前tvdb被墙了后,我一直用的这个方法,另外plex.tv加入翻墙名单不会影响国内直连你的服务器,而且刮削不会收到网络影响。

提供一个我自用的nginx配置给你

server {
        listen 443 ssl;
        http2 on;
        server_name plex.xxx.com;
        ssl_certificate /home/iviso/certs/public.crt;
        ssl_certificate_key /home/iviso/certs/private.key;
        ssl_protocols TLSv1.2 TLSv1.3;
        add_header Strict-Transport-Security "max-age=63072000" always;
        ssl_stapling on;
        ssl_stapling_verify on;
        send_timeout 24h;

location / {
        proxy_pass http://192.168.2.6:32400;
        proxy_http_version 1.1;
        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 Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_connect_timeout 24h;
        proxy_read_timeout 24h;
        proxy_send_timeout 24h;
        client_max_body_size 0;
        proxy_redirect off;
        proxy_buffering off;
    }
}
1 Like