• Rigel Kent's avatar
    refresh nginx config and optimize delivery (#3313) · 5f59cf07
    Rigel Kent authored
    refactors the Nginx configuration for the following points:
    - update tls version to include 1.3 by default. so far it was not included by default to make room for previous versions of Nginx, but since 2018 Debian stable has included Nginx in version 1.14.1, and tls 1.3 is available since Nginx 1.13.0.
    - clearly indicate that new minimum required version.
    - update outdated ssl_ciphers to remove cipher required to support android 4.4, since that version is unsupported since March 2020.
    - reordered configuration in sections for easier maintenance: performance optimizations are separated from the vital application/websocket parts.
    - move parts that always require manual configuration at the top: peertube host and server name, use server_name 
    - move peertube host to a more flexible upstream block: it allows to configure it in one place instead of 3, and is future-proof regarding load-balancing.
    - simplified port 80 block: Let’s Encrypt supports 301 redirects.
    - group certificate-related config together.
    - remove reslover config: it defaults to /etc/resolv.conf which is more than enough.
    - align values with their neighbors for easier reading
    - always specify units
    - always specify default values when they differ from the values set
    - use ’m’ for minutes, ’M’ for megabytes
    - add consensual optimizations wrt file serving:
      - add timeout optimizations
      - add file descriptor cache optimizations
      - enable sendfile with chunk size > rate limit
      - enable threading
      - tcp optimizations
      - point to further, more system-specific optimizations in the section description
    - CDN configuration reduced to one line change