feat(embed): add widget, visitor chat, and management UI (#1657)
Add embed.html entrypoint, floating widget SDK, secure-mode snippets, management panel with preview, visitor chat composables, citation rendering, and integration docs for subdomain and server-side token exchange.
This commit is contained in:
@@ -1,3 +1,17 @@
|
||||
# Optional dedicated embed origin — uncomment and set server_name (e.g. embed.example.com).
|
||||
# Serve only embed.html + static assets; proxy /api to the WeKnora backend.
|
||||
# See docs/embed-subdomain.md
|
||||
#
|
||||
# server {
|
||||
# listen 80;
|
||||
# server_name embed.example.com;
|
||||
# client_max_body_size ${MAX_FILE_SIZE};
|
||||
# location = /weknora-widget.js { root /usr/share/nginx/html; }
|
||||
# location ^~ /embed/ { root /usr/share/nginx/html; try_files $uri $uri/ /embed.html; }
|
||||
# location ^~ /assets/ { root /usr/share/nginx/html; add_header Cache-Control "public, max-age=31536000, immutable"; }
|
||||
# location /api/ { proxy_pass http://weknora-backend:8080; proxy_set_header Host $host; }
|
||||
# }
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
@@ -24,6 +38,23 @@ server {
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
access_log /var/log/nginx/access.log;
|
||||
|
||||
# Static widget loader for third-party sites
|
||||
location = /weknora-widget.js {
|
||||
root /usr/share/nginx/html;
|
||||
add_header Cache-Control "public, max-age=3600" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
}
|
||||
|
||||
# Embed widget pages may be loaded inside third-party iframes (lightweight embed.html)
|
||||
location ^~ /embed/ {
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri $uri/ /embed.html;
|
||||
add_header Cache-Control "no-cache, must-revalidate" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
}
|
||||
|
||||
# 前端静态文件
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
Reference in New Issue
Block a user