apiVersion: v1
kind: ConfigMap
metadata:
  name: omni-configmap
  namespace: omni-manager-website
data:
  default.conf: | 
    map $http_upgrade $connection_upgrade {
      default upgrade;
      '' close;
    }

    server { 
      listen 8080;
      server_name omni.openeuler.sh;
      charset utf-8;
      limit_conn perserver 50;
      if ($request_method = 'OPTIONS') {
        return 401;
      }
      location /ws/queryJobStatus {
        proxy_pass http://omni-manager-backend-service.omni-manager-backend.svc.cluster.local:8888;
        proxy_read_timeout 3600s;
        proxy_connect_timeout 3600s;
        proxy_send_timeout 3600s;

        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
      }

      location / {
        add_header Cache-Control no-cache;

        location /assets {
          # publish every two weeks
          expires 14d;
          add_header Cache-Control public;
        }
        root /usr/share/nginx/html;
        index /index.html;
      }
    }

