apiVersion: v1
kind: ConfigMap
metadata:
  name: roundcube
  labels:
    app.kubernetes.io/instance: roundcube
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: roundcube
    helm.sh/chart: roundcube-4.5.0
  namespace: roundcube
data:
  default.conf: |
    server {
        listen 80 default_server;
        server_name _;
        root /var/www/html;

        location / {
            try_files $uri /index.php$is_args$args;
        }

        location ~ \.php(/|$) {
            try_files $uri =404;
            fastcgi_pass roundcube:9000;
            fastcgi_read_timeout 300;
            proxy_read_timeout 300;
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
            fastcgi_param DOCUMENT_ROOT $realpath_root;
            internal;
        }

        client_max_body_size 6m;

        error_log  /var/log/nginx/error.log;
        access_log /var/log/nginx/access.log;
    }
