torrent.subdomain.conf 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ## Version 2020/12/09
  2. # Make sure that DNS has a cname set for torrent
  3. #
  4. # Some Torrent Chrome extensions cannot handle HTTP/2 proxies as they
  5. # rely on the HTTP Status Text to determine if they should add the
  6. # X-Torrent-Session-Id header or not. HTTP/2 does not return this text
  7. # so jQuery responses are empty. This causes RPCs to fail.
  8. #
  9. # If your extension is affected, you can remove http2 from the default server
  10. # in /config/nginx/site-confs/default or listen on a different port that has
  11. # no http2 servers defined. Better yet, submit a bug report with the
  12. # extension developer to fix their extensions to support HTTP/2.
  13. server {
  14. listen 443 ssl;
  15. listen [::]:443 ssl;
  16. server_name torrent.*;
  17. include /config/nginx/ssl.conf;
  18. client_max_body_size 0;
  19. # enable for ldap auth, fill in ldap details in ldap.conf
  20. #include /config/nginx/ldap.conf;
  21. # enable for Authelia
  22. #include /config/nginx/authelia-server.conf;
  23. location / {
  24. # enable the next two lines for http auth
  25. #auth_basic "Restricted";
  26. #auth_basic_user_file /config/nginx/.htpasswd;
  27. # enable the next two lines for ldap auth
  28. #auth_request /auth;
  29. #error_page 401 =200 /ldaplogin;
  30. # enable for Authelia
  31. #include /config/nginx/authelia-location.conf;
  32. include /config/nginx/proxy.conf;
  33. resolver 127.0.0.11 valid=30s;
  34. set $upstream_app transmission;
  35. set $upstream_port 9091;
  36. set $upstream_proto http;
  37. proxy_pass $upstream_proto://$upstream_app:$upstream_port;
  38. proxy_pass_header X-Torrent-Session-Id;
  39. }
  40. location ~ (/torrent)?/rpc {
  41. include /config/nginx/proxy.conf;
  42. resolver 127.0.0.11 valid=30s;
  43. set $upstream_app transmission;
  44. set $upstream_port 9091;
  45. set $upstream_proto http;
  46. proxy_pass $upstream_proto://$upstream_app:$upstream_port;
  47. }
  48. }