ai-chatbot/deploy/nginx-hicad-zoo-ws.conf.template

36 lines
1.3 KiB
Plaintext

# Include inside the authenticated HiCAD HTTPS server block.
# Replace __AI_CAD_WS_PROXY_SECRET__ during deployment and chmod the rendered file 600.
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;
proxy_pass https://api.zoo.dev/ws/;
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;
}