kind: ConfigMap
apiVersion: v1
metadata:
  name: nginx-config
data:
  nginx-fpm.conf: |
    upstream phpfcgi {
        server php:9000;
        server 127.0.0.1:9000;
        server 127.0.0.1:9001;
    }

    server {
        server_name localhost;
        root /project/public;

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

        location ~ \.php$ {
            fastcgi_pass phpfcgi;
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
            fastcgi_param DOCUMENT_ROOT $realpath_root;
        }
    }
