Add Nginx configs and SSL certificates for fukun.net sites
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# pwd.fukun.net → Vaultwarden
|
||||
# 用法: 复制到服务器 /etc/nginx/sites-enabled/ 后 nginx -s reload
|
||||
#
|
||||
# 前置: SSL 证书已放置到 /etc/nginx/ssl/ 目录
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name pwd.fukun.net;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name pwd.fukun.net;
|
||||
|
||||
# SSL 证书(替换为实际路径)
|
||||
ssl_certificate /etc/nginx/ssl/pwd.fukun.net.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/pwd.fukun.net.key;
|
||||
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
# 代理到 Vaultwarden
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
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;
|
||||
}
|
||||
|
||||
# WebSocket 支持(Bitwarden 通知推送需要)
|
||||
location /notifications/hub {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
|
||||
location /notifications/hub/negotiate {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user