diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-15 17:56:58 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-15 18:07:08 +0100 |
commit | d2000ca6e7fa77758d4f811e4a8af11108d2655d (patch) | |
tree | d40860d17f33eacd33f79780fab08ecb7e6e46a7 /support/nginx/peertube-https | |
parent | 53733ec2abd4b7588c85cdd37824b0082b46f188 (diff) | |
download | PeerTube-d2000ca6e7fa77758d4f811e4a8af11108d2655d.tar.gz PeerTube-d2000ca6e7fa77758d4f811e4a8af11108d2655d.tar.zst PeerTube-d2000ca6e7fa77758d4f811e4a8af11108d2655d.zip |
Update production guide
Use release that already contains build files. It requires a specific
directories tree but I think it would be fine.
Diffstat (limited to 'support/nginx/peertube-https')
-rw-r--r-- | support/nginx/peertube-https | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/support/nginx/peertube-https b/support/nginx/peertube-https deleted file mode 100644 index c3465f74b..000000000 --- a/support/nginx/peertube-https +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | server { | ||
2 | listen 80; | ||
3 | # listen [::]:80; | ||
4 | server_name domain.tld; | ||
5 | rewrite ^ https://$server_name$request_uri? permanent; | ||
6 | } | ||
7 | |||
8 | server { | ||
9 | listen 443 ssl http2; | ||
10 | # listen [::]:443 ssl http2; | ||
11 | server_name domain.tld; | ||
12 | |||
13 | # For example with Let's Encrypt | ||
14 | ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem; | ||
15 | ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem; | ||
16 | ssl_trusted_certificate /etc/letsencrypt/live/domain.tld/chain.pem; | ||
17 | |||
18 | location / { | ||
19 | proxy_pass http://localhost:9000; | ||
20 | proxy_set_header X-Real-IP $remote_addr; | ||
21 | proxy_set_header Host $host; | ||
22 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
23 | |||
24 | # For the video upload | ||
25 | client_max_body_size 2G; | ||
26 | proxy_connect_timeout 600; | ||
27 | proxy_send_timeout 600; | ||
28 | proxy_read_timeout 600; | ||
29 | } | ||
30 | |||
31 | # Bypass PeerTube webseed route for better performances | ||
32 | location /static/webseed { | ||
33 | # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client | ||
34 | limit_rate 800k; | ||
35 | |||
36 | if ($request_method = 'OPTIONS') { | ||
37 | add_header 'Access-Control-Allow-Origin' '*'; | ||
38 | add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; | ||
39 | add_header 'Access-Control-Allow-Headers' 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; | ||
40 | add_header 'Access-Control-Max-Age' 1728000; | ||
41 | add_header 'Content-Type' 'text/plain charset=UTF-8'; | ||
42 | add_header 'Content-Length' 0; | ||
43 | return 204; | ||
44 | } | ||
45 | |||
46 | if ($request_method = 'GET') { | ||
47 | add_header 'Access-Control-Allow-Origin' '*'; | ||
48 | add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; | ||
49 | add_header 'Access-Control-Allow-Headers' 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; | ||
50 | } | ||
51 | |||
52 | alias /your/installation/PeerTube/videos; | ||
53 | } | ||
54 | |||
55 | # Websocket tracker | ||
56 | location /tracker/socket { | ||
57 | # Peers send a message to the tracker every 15 minutes | ||
58 | # Don't close the websocket before this time | ||
59 | proxy_read_timeout 1200s; | ||
60 | proxy_set_header Upgrade $http_upgrade; | ||
61 | proxy_set_header Connection "upgrade"; | ||
62 | proxy_http_version 1.1; | ||
63 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
64 | proxy_set_header Host $host; | ||
65 | proxy_pass http://localhost:9000; | ||
66 | } | ||
67 | } | ||