sudo apt install nginx<\/pre>\n\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5f00\u542fssl\u4e0e\u53cd\u5411\u4ee3\u7406\uff0c\u5728\/etc\/nginx\/conf.d\u4e0b\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6youdomain.com.conf\uff0cyoudomain.com\u4e3a\u7528\u6765\u8bbf\u95ee\u7684\u57df\u540d\u3002<\/p>\n
\u6587\u4ef6\u5185\u5bb9\uff1a<\/p>\n
server\r\n {\r\n listen 80;\r\n #listen [::]:80;\r\n server_name youdomain.com; #\u628ayoudomain.com\u4fee\u6539\u4e3a\u7528\u6765\u8bbf\u95ee\u7684\u57df\u540d\r\n\t\trewrite ^\/(.*) https:\/\/$server_name\/$1 permanent;\r\n }\r\n\r\nserver\r\n {\r\n listen 443 ssl http2;\r\n #listen [::]:443 ssl http2;\r\n server_name youdomain.com; #\u628ayoudomain.com\u4fee\u6539\u4e3a\u7528\u6765\u8bbf\u95ee\u7684\u57df\u540d\r\n \r\n location \/ {\r\n proxy_pass http:\/\/127.0.0.1:8000;\r\n proxy_set_header Host $host;\r\n proxy_set_header X-Real-IP $remote_addr;\r\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n proxy_set_header X-Forwarded-Proto $scheme;\r\n }\r\n \r\n location \/notifications\/hub {\r\n proxy_pass http:\/\/127.0.0.1:3012;\r\n proxy_set_header Upgrade $http_upgrade;\r\n proxy_set_header Connection \"upgrade\";\r\n }\r\n \r\n location \/notifications\/hub\/negotiate {\r\n proxy_pass http:\/\/127.0.0.1:8000;\r\n }\r\n # \u52a0\u5165robots.txt \u9632\u6b62\u641c\u7d22\u5f15\u64ce\u722c\u866b\u6293\u53d6\r\n location = \/robots.txt {\r\n root \/home\/wwwroot\/Bitwarden;\r\n }\r\n }<\/pre>\n\u5728vhost\u76ee\u5f55\/home\/wwwroot\/Bitwarden\u521b\u5efa\u4e00\u4e2arobots.txt \u6587\u4ef6\uff0c\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9\u7981\u6b62\u641c\u7d22\u5f15\u64ce\u722c\u866b\u6293\u53d6<\/p>\n
User-agent: *\r\nDisallow: \/<\/pre>\n\u91cd\u542fnginx<\/p>\n
service nginx restart<\/pre>\n\u56db\u3001\u5907\u4efd\u6570\u636e<\/strong><\/div>\n\u6570\u636e\u65e0\u4ef7,\u8bbe\u7f6e\u5b9a\u65f6\u5907\u4efd\u6570\u636e\u5e93\u3002bitwarden-rs\u7684\u6570\u636e\u5e93\u5728\/bw-data\u76ee\u5f55\uff0c\u91cc\u9762\u8fd8\u6709\u5bc6\u94a5\u6587\u4ef6\u548c\u7f51\u7ad9\u56fe\u6807\u7f13\u5b58\uff0c\u8fd9\u4e9b\u90fd\u662f\u53ef\u9009\u7684\uff0c\u4ee5\u4e0b\u811a\u672c\u53ea\u5907\u4efd\u6570\u636e\u5e93\u3002<\/p>\n
#!\/bin\/bash\r\n# https:\/\/gist.github.com\/vitobotta\/3a6c53c3693ff77cd0c920d0a541622d#file-bitwarden_rs-backup-sh-L25\r\nexport LC_ALL=C\r\n\r\nnow=$(date +\"%Y%m%d-%H%M%S\")\r\nparent_dir=\"\/home\/\/bitwarden\/bw-data\"\r\nbackups_dir=\"${parent_dir}\/backups\"\r\nlog_file=\"${backups_dir}\/backup-progress.log.${now}\"\r\ntmp_sqlite_backup=\"backups\/db.sqlite3.${now}\"\r\narchive=\"backups\/backup.tar.gz.${now}\"\r\n\r\nerror () {\r\n printf \"%s: %s\\n\" \"$(basename \"${BASH_SOURCE}\")\" \"${1}\" >&2\r\n exit 1\r\n}\r\n\r\ntrap 'error \"An unexpected error occurred.\"' ERR\r\n\r\ntake_backup () {\r\n cd \"${parent_dir}\"\r\n \r\n sqlite3 db.sqlite3 \".backup '${tmp_sqlite_backup}'\"\r\n \/bin\/tar czf \"${archive}\" \"${tmp_sqlite_backup}\" attachments\r\n\r\n rm \"${tmp_sqlite_backup}\"\r\n\r\n find \"${backups_dir}\/\" -type f -mtime +30 -exec rm {} \\;\r\n}\r\n\r\nprintf \"\\n=======================================================================\"\r\nprintf \"\\nBitwarden Backup\"\r\nprintf \"\\n=======================================================================\"\r\nprintf \"\\nBackup in progress...\"\r\n\r\ntake_backup 2> \"${log_file}\"\r\n\r\nif [[ -s \"${log_file}\" ]]\r\nthen\r\n printf \"\\nBackup failure! Check ${log_file} for more information.\"\r\n printf \"\\n=======================================================================\\n\\n\"\r\nelse\r\n rm \"${log_file}\"\r\n printf \"...SUCCESS!\\n\"\r\n printf \"Backup created at ${backups_dir}\/backup.tar.gz.${now}\"\r\n printf \"\\n=======================================================================\\n\\n\"\r\nfi<\/pre>\n\u8bbe\u7f6e\u5b9a\u65f6\u4efb\u52a1\uff0c\u4fee\u6539\u6587\u4ef6 \/etc\/crontab\u63d2\u5165\u4e00\u4e0b\u5185\u5bb9<\/p>\n
00 1 * * * root \/home\/\/bitwarden\/bw-data\/backups\/bitwarden_rs-backup.sh<\/pre>\n\u4ee5\u4e0a\u8868\u793a\uff0c\u6bcf\u5929\u51cc\u6668 1 \uff0croot \u7528\u6237\u6267\u884c\u4e00\u6b21 bitwarden_rs-backup.sh \u811a\u672c\u3002
\n\u540e\u671f\u52a0\u90ae\u4ef6\u63d0\u9192<\/p>\n
\u6ce8\u518c\u5b8c\u8d26\u53f7\u540e\uff0c\u628aSIGNUPS_ALLOWED\u9009\u9879\u6539\u6210fale\u91cd\u542f\u5b9e\u4f8b\u5173\u95ed\u6ce8\u518c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u672c\u6587\u5e72\u8d27\u541b\u4f7f\u7528\u670d\u52a1\u5668\u642d\u5efa\u4e00\u6b3e\u6570\u636e\u5728\u81ea\u5df1\u670d\u52a1\u5668\u4e0a\u7684Bitwarden\u5bc6\u7801\u7ba1\u7406\u5668\u3002 \u90e8\u7f72\u73af\u5883\u4e3aubuntu\uff0c\u4f7f\u7528d […]<\/p>\n","protected":false},"author":1469,"featured_media":262102,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-262097","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/262097","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=262097"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/262097\/revisions"}],"predecessor-version":[{"id":262103,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/262097\/revisions\/262103"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/262102"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=262097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=262097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=262097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}