From 8a0caeb23d76b018218dfbbda7a5d8c6565176aa Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 12 May 2026 14:56:33 +0500 Subject: [PATCH] ++ --- apps/django/base/nginx-configmap.yaml | 96 +++++++++++++------ .../infrastructure/patches/istio-config.yaml | 26 ++--- 2 files changed, 79 insertions(+), 43 deletions(-) diff --git a/apps/django/base/nginx-configmap.yaml b/apps/django/base/nginx-configmap.yaml index a4a7135..1464b62 100644 --- a/apps/django/base/nginx-configmap.yaml +++ b/apps/django/base/nginx-configmap.yaml @@ -5,50 +5,83 @@ metadata: namespace: django data: nginx.conf: | - user nginx; - worker_processes auto; - - error_log stderr warn; - pid /var/run/nginx.pid; + worker_processes auto; + pid /var/run/nginx.pid; events { - worker_connections 1024; + use epoll; + worker_connections 1024; } - http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + # Basic Settings + large_client_header_buffers 8 128k; + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 300; + types_hash_max_size 2048; + client_max_body_size 5000M; + client_header_buffer_size 5M; + # server_tokens off; + # server_names_hash_bucket_size 64; + # server_name_in_redirect off; + include /etc/nginx/mime.types; + default_type application/octet-stream; + + # Logging Settings + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + # GZIP Settings + gzip on; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /dev/stdout main; - - sendfile on; - - keepalive_timeout 65; - - gzip on; - server { - client_header_buffer_size 16k; - large_client_header_buffers 4 16k; - listen 80; - server_name localhost; - root /opt/react_client; - expires off; + listen 80; + listen [::]:80; + root /opt/react_client/; + + add_header 'Access-Control-Allow-Origin' '*' always; + add_header 'Access-Control-Allow-Methods' '*' always; + add_header 'Access-Control-Allow-Headers' '*' always; location = /static/index.bundle.js { add_header Cache-Control 'no-store no-cache, must-revalidate, proxy-revalidate, max-age=0'; if_modified_since off; expires off; } + location ~^/api/pm/ { + #rewrite /api/(.+) /$1 break; + proxy_set_header Host $host; + proxy_pass http://backend-svc.pm.svc.cluster.local:8000; + } - location / { - try_files $uri @index; + location ~^/api/v1/documents/ { + #rewrite /api/(.+) /$1 break; + proxy_set_header Host $host; + proxy_pass http://backend-filestream-svc.documentations.svc.cluster.local:80; + } + + # location ~^/(api|admin)/ { + # proxy_set_header Host $host; + # proxy_pass http://backend-svc.django.svc.cluster.local:80; + # } + + location ~^/workspaces-v2/(.+).js { + rewrite /workspaces-v2/(.+) /$1 break; + proxy_pass http://frontend-svc.workspaces.svc.cluster.local:80; } location @index { @@ -57,14 +90,17 @@ data: expires off; try_files /static/index.html =404; } - + + # location ~^/workflows/(.+).js { + # rewrite /workflows/(.+) /$1 break; + # proxy_pass http://frontend-svc.processing.svc.cluster.local:80; + # } location /service-worker.js { try_files /static/$uri @index; } - - location = /ping { - return 200 '{"result": "ok"}'; + location / { + try_files $uri @index; } } } diff --git a/clusters/yc-k8s-test/infrastructure/patches/istio-config.yaml b/clusters/yc-k8s-test/infrastructure/patches/istio-config.yaml index c38ccd4..c869623 100644 --- a/clusters/yc-k8s-test/infrastructure/patches/istio-config.yaml +++ b/clusters/yc-k8s-test/infrastructure/patches/istio-config.yaml @@ -325,19 +325,19 @@ spec: rewrite: /api/ service: backend-svc.workspaces.svc.cluster.local port: 80 - workspaces-frontend: - name: workspaces-frontend-virt-service - namespace: gateway - hosts: - - sarex.contour.infra.sarex.tech - gateways: - - gateway/platform-gateway - routes: - - path: - prefix: /workspaces-v2/ - rewrite: / - service: frontend-svc.workspaces.svc.cluster.local - port: 80 + # workspaces-frontend: + # name: workspaces-frontend-virt-service + # namespace: gateway + # hosts: + # - sarex.contour.infra.sarex.tech + # gateways: + # - gateway/platform-gateway + # routes: + # - path: + # prefix: /workspaces-v2/ + # rewrite: / + # service: frontend-svc.workspaces.svc.cluster.local + # port: 80 documentations-frontend: name: documentations-frontend-virt-service namespace: gateway