042f66499a
- Add missing lucide-react icons (Users, Target, MessageCircle, Layers, CreditCard) - Fix admin/page.test.tsx ESLint errors (add displayName) - Fix api/contact/route.test.ts ESLint errors (remove any types, use import) - Add RESEND_API_KEY environment variable for API tests - All 122 test suites now passing - Test pass rate: 99.8% (1499/1502 passed, 3 skipped)
74 lines
2.7 KiB
Bash
Executable File
74 lines
2.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# 修复Jenkins Nginx配置
|
|
cat > /tmp/jenkins-nginx-fix.conf << 'EOF'
|
|
# Jenkins CI/CD Server
|
|
server {
|
|
listen 80;
|
|
server_name ci.f.novalon.cn;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name ci.f.novalon.cn;
|
|
|
|
ssl_certificate /etc/nginx/ssl/ci.f.novalon.cn/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/ssl/ci.f.novalon.cn/privkey.pem;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305;
|
|
ssl_prefer_server_ciphers off;
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_session_timeout 1d;
|
|
|
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
|
|
# Jenkins webhook端点 - 不需要/jenkins前缀
|
|
location /generic-webhook-trigger/ {
|
|
proxy_pass http://172.17.0.1:8080/generic-webhook-trigger/;
|
|
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 $scheme;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
client_max_body_size 100m;
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
# Jenkins主应用
|
|
location /jenkins/ {
|
|
proxy_pass http://172.17.0.1:8080/jenkins/;
|
|
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 $scheme;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
client_max_body_size 100m;
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
# 默认location - 重定向到/jenkins/
|
|
location / {
|
|
return 301 https://$host/jenkins/;
|
|
}
|
|
|
|
access_log /var/log/nginx/jenkins-access.log;
|
|
error_log /var/log/nginx/jenkins-error.log;
|
|
}
|
|
EOF
|
|
|
|
echo "Jenkins Nginx配置已生成"
|