ai-chatbot/deploy/nginx/pascal-service.conf.template

44 lines
1.6 KiB
Plaintext

# Include this file inside the authenticated bbyy.ai HTTPS server block.
# Replace __PASCAL_PROXY_SECRET__ during deployment and chmod the rendered file 600.
location = /_pascal_auth {
internal;
proxy_pass http://127.0.0.1:3125/api/internal/pascal/access;
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-Pascal-Proxy-Secret "__PASCAL_PROXY_SECRET__";
}
location = /pascal-service {
return 302 /pascal-service/scenes;
}
location ^~ /pascal-service/ {
auth_request /_pascal_auth;
auth_request_set $pascal_user_id $upstream_http_x_pascal_user_id;
proxy_pass http://127.0.0.1:3002;
proxy_http_version 1.1;
proxy_hide_header X-Powered-By;
proxy_set_header Host $host;
proxy_set_header Cookie "";
proxy_set_header Authorization "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Pascal-User-Id $pascal_user_id;
proxy_set_header X-Pascal-Agent-Proxy-Secret "__PASCAL_PROXY_SECRET__";
proxy_set_header X-Pascal-Scene-Token "__PASCAL_PROXY_SECRET__";
proxy_set_header Connection "";
proxy_buffering off;
proxy_request_buffering off;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
proxy_connect_timeout 30s;
}