apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-tuleap-conf
data:
  tuleap.conf.dist: |
    upstream tuleap-apache {
        server 127.0.0.1:8080;
    }

    upstream tuleap-php-fpm {
        server 127.0.0.1:9000;
    }

    upstream tuleap-php-fpm-long-running-request {
        server 127.0.0.1:9002;
    }

    server {
            listen       443 ssl http2;
            listen       [::]:443 ssl http2;
            server_name  %sys_default_domain%;

            ssl_certificate %ssl_certificate_path%;
            ssl_certificate_key %ssl_certificate_key_path%;
            ssl_session_timeout 1d;
            ssl_session_cache shared:MozSSL:10m;
            ssl_session_tickets off;

            # Tweak to your needs
            ssl_protocols TLSv1.2;
            ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
            ssl_prefer_server_ciphers off;

            # Tweak for file upload and SVN
            client_max_body_size 256M;

            include conf.d/tuleap.d/*.conf;
    }

    server {
        listen       80;
        listen       [::]:80;
        server_name  %sys_default_domain%;

        if ($http_x_forwarded_proto != "https") {
          return 301 https://$server_name:443$request_uri;
        }
        # else
        # Tweak for file upload and SVN
        client_max_body_size 256M;

        include conf.d/tuleap.d/*.conf;
    }
