apiVersion: v1
kind: ConfigMap
metadata:
  name: monitor1-configmap-nginx
  namespace: default
data:
  nginx.conf: |
    events {
      worker_connections  4096;  ## Default: 1024
    }

    http {
        server {
            listen 8000;
            listen [::]:8000;
            
            server_name _;

            location /socket.io {
                proxy_http_version 1.1;
                proxy_buffering off;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_pass http://monitor1-backend-svc.default.svc.cluster.local:8081/socket.io;
            }
            
            location /api {
                proxy_pass http://monitor1-backend-svc.default.svc.cluster.local:8081/api;
            }
            
            location / {
                proxy_pass http://monitor1-frontend-svc.default.svc.cluster.local:8080;
            }
        }
    }