feat: import Sea vHost single-server testing release

This commit is contained in:
canglan committed 2026-10-30 08:39:10 +08:00
commit 248badd33e
441 files changed
+63221

No files matched your search

@@ -0,0 +1,20 @@
# Defense-in-depth for an aaPanel reverse-proxy server block.
# Include this file inside the public aaPanel `server {}` block, before the
# catch-all proxy location. It intentionally disables browser terminal and
# other privileged WebSocket features; normal signed HTTP API calls continue.
#
# This is not sufficient while the aaPanel backend port remains reachable
# from untrusted networks. Bind/restrict that port with a firewall, security
# group, VPN, or SSH tunnel as the primary control.
location = /sock_shell { return 403; }
location = /webssh { return 403; }
location = /ws_panel { return 403; }
location = /ws_home { return 403; }
location = /ws_project { return 403; }
location = /ws_model { return 403; }
location = /workorder_client { return 403; }
location ~ ^/v2/(?:sock_shell|webssh|ws_panel|ws_home|ws_project|ws_model|workorder_client)$ {
return 403;
}
@@ -0,0 +1,3 @@
# Managed by Sea vHost. Local changes will be replaced.
limit_req_zone $binary_remote_addr$server_name zone=sea_vhost_per_ip:10m rate=20r/s;
limit_conn_zone $binary_remote_addr$server_name zone=sea_vhost_per_ip_conn:10m;
+61
View File
@@ -0,0 +1,61 @@
map $upstream_http_content_security_policy $sea_vhost_csp {
"" "default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; form-action 'self'; connect-src 'self'; img-src 'self' data:; font-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self'";
default $upstream_http_content_security_policy;
}
server {
listen 80;
server_name host.ser888.cn;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name host.ser888.cn;
server_tokens off;
# 证书可由宝塔站点设置生成;部署前替换路径。
ssl_certificate /www/server/panel/vhost/cert/host.ser888.cn/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/host.ser888.cn/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "same-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
add_header Content-Security-Policy $sea_vhost_csp always;
root /opt/sea-vhost/web;
index index.html;
client_max_body_size 21m;
proxy_hide_header Content-Security-Policy;
location /api/ {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
# Management responses are private; override any server-wide proxy cache.
proxy_cache off;
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
# Keep an explicit public port (when present) for strict Origin checks.
proxy_set_header Host $http_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_connect_timeout 3s;
proxy_read_timeout 300s;
}
location = /healthz {
proxy_pass http://127.0.0.1:8080;
access_log off;
}
location / {
try_files $uri $uri/ /index.html;
}
location ~ /\. {
deny all;
}
}