torrent.conf 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. ## Configuração para torrent.partidopirata.org
  2. server {
  3. listen 80;
  4. listen [::]:80;
  5. server_name torrent.partidopirata.org;
  6. return 301 https://torrent.partidopirata.org$request_uri;
  7. }
  8. ## SSL
  9. server {
  10. listen 443 ssl;
  11. listen [::]:443 ssl;
  12. server_name torrent.partidopirata.org;
  13. index index.html;
  14. # Use large keepalive timeout for faster subsequent connections
  15. keepalive_timeout 150;
  16. # SSL configuration
  17. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  18. ssl_prefer_server_ciphers on;
  19. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  20. ssl_ecdh_curve secp384r1;
  21. ssl_session_cache shared:SSL:10m;
  22. ssl_session_tickets off;
  23. ssl_stapling on;
  24. ssl_stapling_verify on;
  25. resolver 208.67.220.220 208.67.222.222 valid=300s;
  26. resolver_timeout 5s;
  27. add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
  28. add_header X-Frame-Options SAMEORIGIN;
  29. add_header X-Content-Type-Options nosniff;
  30. ssl_certificate /etc/letsencrypt/live/partidopirata.org-0001/fullchain.pem;
  31. ssl_certificate_key /etc/letsencrypt/live/partidopirata.org-0001/privkey.pem;
  32. ssl_trusted_certificate /etc/letsencrypt/live/partidopirata.org-0001/chain.pem;
  33. # Allow file uploads
  34. client_max_body_size 1200M;
  35. # Only retry if there was a communication error, not a timeout
  36. # on the app server (to avoid propagating "queries of death"
  37. # to all frontends)
  38. proxy_next_upstream error;
  39. # If node has an error then nginx will intercept it if there is
  40. # an error_page directive for that error code. So far, just doing
  41. # this for 50x errors.
  42. proxy_intercept_errors on;
  43. # Serve the root from node
  44. location / {
  45. proxy_pass_header Server;
  46. proxy_set_header Host $http_host;
  47. proxy_redirect off;
  48. #proxy_set_header X-Forwarded-For $remote_addr;
  49. proxy_set_header X-Forwarded-Proto $scheme;
  50. proxy_pass http://127.0.0.1:4000;
  51. proxy_intercept_errors on;
  52. error_page 501 502 503 504 /50x.html;
  53. }
  54. ## TODO: Alguém escreve uma página pra erros 50x?
  55. # Serve 500 file
  56. #location = /50x.html {
  57. # root /home/feross/www/instant.io/static;
  58. #}
  59. }
  60. ## Tor
  61. server {
  62. listen 127.0.0.1:42912;
  63. allow 127.0.0.1;
  64. deny all;
  65. server_name twebheztijgt5qhj.onion;
  66. index index.html;
  67. # Use large keepalive timeout for faster subsequent connections
  68. keepalive_timeout 150;
  69. # Allow file uploads
  70. client_max_body_size 1200M;
  71. # Only retry if there was a communication error, not a timeout
  72. # on the app server (to avoid propagating "queries of death"
  73. # to all frontends)
  74. proxy_next_upstream error;
  75. # If node has an error then nginx will intercept it if there is
  76. # an error_page directive for that error code. So far, just doing
  77. # this for 50x errors.
  78. proxy_intercept_errors on;
  79. # Serve the root from node
  80. location / {
  81. proxy_pass_header Server;
  82. proxy_set_header Host $http_host;
  83. proxy_redirect off;
  84. #proxy_set_header X-Forwarded-For $remote_addr;
  85. proxy_set_header X-Forwarded-Proto $scheme;
  86. proxy_pass http://127.0.0.1:4000;
  87. proxy_intercept_errors on;
  88. error_page 501 502 503 504 /50x.html;
  89. }
  90. ## TODO: Alguém escreve uma página pra erros 50x?
  91. # Serve 500 file
  92. #location = /50x.html {
  93. # root /home/feross/www/instant.io/static;
  94. #}
  95. }