Files
dingMCP/deploy/approval.justconn.top.nginx.conf
T
gitea-admin b7313ab74d
CI / Client installer (macos-latest) (push) Canceled after 0s
CI / Client installer (ubuntu-latest) (push) Canceled after 0s
CI / Client installer (windows-latest) (push) Canceled after 0s
CI / test (22) (push) Canceled after 0s
CI / test (24) (push) Canceled after 0s
CI / release-smoke (push) Canceled after 0s
feat: support secure XFT submission attachments
2026-09-01 03:44:36 +00:00

129 lines
5.2 KiB
Plaintext

server {
listen 80;
listen [::]:80;
server_name approval.justconn.top;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name approval.justconn.top;
ssl_certificate /etc/letsencrypt/live/approval.justconn.top/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/approval.justconn.top/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
client_max_body_size 1m;
add_header Strict-Transport-Security "max-age=31536000" always;
location = /downloads/dingmcp/install.md {
alias /var/www/approval.justconn.top/downloads/dingmcp/install.md;
default_type text/markdown;
charset utf-8;
charset_types text/markdown;
add_header Strict-Transport-Security "max-age=31536000" always;
add_header Cache-Control "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Content-Security-Policy "default-src 'none'" always;
}
location = /downloads/dingmcp/compat-install.md {
alias /var/www/approval.justconn.top/downloads/dingmcp/compat-install.md;
default_type text/markdown;
charset utf-8;
charset_types text/markdown;
add_header Strict-Transport-Security "max-age=31536000" always;
add_header Cache-Control "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Content-Security-Policy "default-src 'none'" always;
}
location = /downloads/dingmcp/manifest.json {
alias /var/www/approval.justconn.top/downloads/dingmcp/manifest.json;
default_type application/json;
add_header Strict-Transport-Security "max-age=31536000" always;
add_header Cache-Control "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Content-Security-Policy "default-src 'none'" always;
}
location = /downloads/dingmcp/manifest.sig {
root /var/www/approval.justconn.top;
default_type application/json;
add_header Strict-Transport-Security "max-age=31536000" always;
add_header Cache-Control "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
}
location = /downloads/dingmcp/agent-test-install.md {
root /var/www/approval.justconn.top;
default_type text/markdown;
charset utf-8;
charset_types text/markdown;
add_header Strict-Transport-Security "max-age=31536000" always;
add_header Cache-Control "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
}
location ~ ^/downloads/dingmcp/(?:dingtalk-approval-installer\.mjs|dingtalk-approval-bootstrap\.(?:ps1|sh)|dingtalk-approval-SKILL\.md|release-signing-public\.pem|SHA256SUMS|dingmcp-test-bundle\.tar\.gz)$ {
root /var/www/approval.justconn.top;
add_header Strict-Transport-Security "max-age=31536000" always;
add_header Cache-Control "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
}
location /downloads/dingmcp/ {
alias /var/www/approval.justconn.top/downloads/dingmcp/;
autoindex off;
add_header Strict-Transport-Security "max-age=31536000" always;
add_header Cache-Control "public, max-age=31536000, immutable" always;
add_header X-Content-Type-Options "nosniff" always;
}
location = /xft/submission-attachments {
client_max_body_size 50m;
proxy_pass http://127.0.0.1:3010;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Authorization $http_authorization;
# Attachment bytes must be forwarded in real time and never spooled
# into Nginx temporary files on the gateway.
proxy_request_buffering off;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 120s;
proxy_send_timeout 120s;
add_header Strict-Transport-Security "max-age=31536000" always;
add_header Cache-Control "no-store" always;
add_header Pragma "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
}
location / {
proxy_pass http://127.0.0.1:3010;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Authorization $http_authorization;
proxy_set_header Mcp-Session-Id $http_mcp_session_id;
proxy_buffering off;
proxy_cache off;
# MCP sessions have a hard 24-hour lifetime in the gateway. Keep the
# reverse proxy from expiring a healthy, otherwise idle stream first.
proxy_read_timeout 25h;
add_header Strict-Transport-Security "max-age=31536000" always;
add_header Cache-Control "no-store" always;
add_header Pragma "no-cache" always;
add_header X-Content-Type-Options "nosniff" always;
}
}