# Include inside the authenticated HiCAD HTTPS server block. # Replace __AI_CAD_WS_PROXY_SECRET__ during deployment and chmod the rendered file 600. location ^~ /vendor/zoo-modeling-app/assets { root /var/www/ai-chatbot/public; try_files $uri =404; gzip_static on; add_header Cache-Control "public, max-age=31536000, immutable" always; } location ^~ /vendor/zoo-modeling-app/fonts/ { root /var/www/ai-chatbot/public; try_files $uri =404; add_header Cache-Control "public, max-age=31536000, immutable" always; } location = /vendor/zoo-modeling-app/kcl_wasm_lib_bg.wasm { root /var/www/ai-chatbot/public; try_files $uri =404; gzip_static on; add_header Cache-Control "public, max-age=3600" always; } location = /_hicad_zoo_ws_auth { internal; proxy_pass http://127.0.0.1:3125/api/ai-cad/zoo-ws-authorize; proxy_pass_request_body off; proxy_set_header Content-Length ""; proxy_set_header Host $host; proxy_set_header Cookie $http_cookie; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-HiCAD-Original-URI $request_uri; proxy_set_header X-HiCAD-WS-Proxy-Secret "__AI_CAD_WS_PROXY_SECRET__"; } location ^~ /api/ai-cad/zoo-ws/ { auth_request /_hicad_zoo_ws_auth; auth_request_set $zoo_authorization $upstream_http_x_zoo_authorization; # Resolve at request time and skip AAAA records because the production host # has no IPv6 route. This avoids a long failed IPv6 retry on cold connects. resolver 1.1.1.1 8.8.8.8 ipv6=off valid=300s; set $zoo_api_host api.zoo.dev; rewrite ^/api/ai-cad/zoo-ws/(.*)$ /ws/$1 break; proxy_pass https://$zoo_api_host$uri$is_args$args; proxy_http_version 1.1; proxy_ssl_server_name on; proxy_ssl_name api.zoo.dev; proxy_set_header Host api.zoo.dev; proxy_set_header Origin https://app.zoo.dev; proxy_set_header Authorization $zoo_authorization; proxy_set_header Cookie ""; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_buffering off; proxy_request_buffering off; proxy_read_timeout 3600s; proxy_send_timeout 3600s; }