44 lines
1.6 KiB
Plaintext
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://__MAIN_NGINX_UPSTREAM__/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_BASE_PATH__ {
|
|
return 302 __PASCAL_BASE_PATH__/scenes;
|
|
}
|
|
|
|
location ^~ __PASCAL_BASE_PATH__/ {
|
|
auth_request /_pascal_auth;
|
|
auth_request_set $pascal_user_id $upstream_http_x_pascal_user_id;
|
|
|
|
proxy_pass http://__PASCAL_NGINX_UPSTREAM__;
|
|
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;
|
|
}
|