feat: import Sea vHost single-server testing release
This commit is contained in:
commit
248badd33e
441 files changed
+63221
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user