From 85cd9bde5a93500f973773f46680c07dd90d5912 Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Thu, 11 Jan 2018 10:45:06 +0100
Subject: Remove unused webserver configuration

And update nginx configuration with a rate limit
---
 support/nginx/peertube-https | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'support/nginx/peertube-https')

diff --git a/support/nginx/peertube-https b/support/nginx/peertube-https
index 794920280..c3465f74b 100644
--- a/support/nginx/peertube-https
+++ b/support/nginx/peertube-https
@@ -6,8 +6,8 @@ server {
 }
 
 server {
-  listen 443 ssl http2; # spdy is deprecated on nginx
-  # listen [::]:443 ssl spdy;
+  listen 443 ssl http2;
+  # listen [::]:443 ssl http2;
   server_name domain.tld;
 
   # For example with Let's Encrypt
@@ -30,6 +30,9 @@ server {
 
   # Bypass PeerTube webseed route for better performances
   location /static/webseed {
+    # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client
+    limit_rate 800k;
+
     if ($request_method = 'OPTIONS') {
       add_header 'Access-Control-Allow-Origin' '*';
       add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
-- 
cgit v1.2.3