YouROK / TorrServer

Torrent stream server
GNU General Public License v3.0
1.34k stars 178 forks source link

[BUG] Ошибка кнопки "Плейлист" #380

Closed egorovna26 closed 2 months ago

egorovna26 commented 2 months ago

Через nginx настроен редирект на torrserver. Включён --ssl. Пример конфигурации:

server { listen 443 ssl default_server; listen [::]:443 ssl default_server;

server_name domainname.ru;

ssl_certificate /etc/letsencrypt/live/domainname.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domainname.ru/privkey.pem;

location / {
    proxy_pass         https://127.0.0.1:8091;
    proxy_http_version 1.1;
    proxy_set_header   Upgrade           $http_upgrade;
    proxy_set_header   Connection        keep-alive;
    proxy_cache_bypass $http_upgrade;
    proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Proto $scheme;
    proxy_set_header   X-Forwarded-Host  $http_host;
    proxy_set_header   X-Real-IP         $remote_addr;
    proxy_set_header   X-NginX-Proxy     true;
    proxy_set_header   Host              $http_host;
}

}

При скачивании m3u плейлиста в него подставляется адрес localhost:8090

EXTM3U

EXTINF:0,Shogun.S01E01.WEB-DLRip.x264.seleZen.mkv

https://localhost:8090/stream/Shogun.S01E01.WEB-DLRip.x264.seleZen.mkv?link=f339458ef62603b2b3bbb29cd100a5a8eded8f44&index=1&play

EXTINF:0,Shogun.S01E02.WEB-DLRip.x264.seleZen.mkv

https://localhost:8090/stream/Shogun.S01E02.WEB-DLRip.x264.seleZen.mkv?link=f339458ef62603b2b3bbb29cd100a5a8eded8f44&index=2&play

EXTINF:0,Shogun.S01E03.WEB-DLRip.x264.seleZen.mkv

https://localhost:8090/stream/Shogun.S01E03.WEB-DLRip.x264.seleZen.mkv?link=f339458ef62603b2b3bbb29cd100a5a8eded8f44&index=3&play

EXTINF:0,Shogun.S01E04.WEB-DLRip.x264.seleZen.mkv

https://localhost:8090/stream/Shogun.S01E04.WEB-DLRip.x264.seleZen.mkv?link=f339458ef62603b2b3bbb29cd100a5a8eded8f44&index=4&play

EXTINF:0,Shogun.S01E05.WEB-DLRip.x264.seleZen.mkv

https://localhost:8090/stream/Shogun.S01E05.WEB-DLRip.x264.seleZen.mkv?link=f339458ef62603b2b3bbb29cd100a5a8eded8f44&index=5&play

EXTINF:0,Shogun.S01E06.WEB-DLRip.x264.seleZen.mkv

https://localhost:8090/stream/Shogun.S01E06.WEB-DLRip.x264.seleZen.mkv?link=f339458ef62603b2b3bbb29cd100a5a8eded8f44&index=6&play

EXTINF:0,Shogun.S01E07.WEB-DLRip.x264.seleZen.mkv

https://localhost:8090/stream/Shogun.S01E07.WEB-DLRip.x264.seleZen.mkv?link=f339458ef62603b2b3bbb29cd100a5a8eded8f44&index=7&play

Версия MatriX.132

tsynik commented 2 months ago

Это не ошибка торрсервера. Для корректного подставления url в плейлист нужно правильно настроить заголовки в nginx. Или же в принципе его не использовать а указать в torrserver для ssl 443 порт и пути к сертификатам и ходить напрямую. p.s. Для https нужны как минимум эти:

      proxy_set_header X-Scheme https;
      proxy_set_header X-Forwarded-Proto https;
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Real-PORT $remote_port;