嘟嘟社区

[nginx] bitwarden设置自动同步报错


我在config里面添加了同步的代码,似乎语法错误?有大佬知道怎么解决嘛?

[nginx]  bitwarden设置自动同步报错

  1.     location / {
  2.         proxy_pass http://127.0.0.1:6666;
  3.         proxy_set_header Host $host;
  4.         proxy_set_header X-Real-IP $remote_addr;
  5.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  6.         proxy_set_header X-Forwarded-Proto $scheme;
  7.     }
  8.   
  9.     location /notifications/hub {
  10.         proxy_pass http://127.0.0.1:3012;
  11.         proxy_set_header Upgrade $http_upgrade;
  12.         proxy_set_header Connection "upgrade";
  13.     }
  14.   
  15.     location /notifications/hub/negotiate {
  16.         proxy_pass http://127.0.0.1:6666;
  17.     }

复制代码

这是我的config配置:

  1. server
  2. {
  3.     listen 80;
  4.         listen 443 ssl http2;
  5.     server_name pwn1337password.software;
  6.     index index.php index.html index.htm default.php default.htm default.html;
  7.     root /www/wwwroot/pwn1337password.software;
  8.     #SSL-START SSL related configuration, do NOT delete or modify the next line of commented-out 404 rules
  9.     #error_page 404/404.html;
  10.     #HTTP_TO_HTTPS_START
  11.     if ($server_port !~ 443){
  12.         rewrite ^(/.*)$ https://$host$1 permanent;
  13.     }
  14.     #HTTP_TO_HTTPS_END
  15.     ssl_certificate    /www/server/panel/vhost/cert/pwn1337password.software/fullchain.pem;
  16.     ssl_certificate_key    /www/server/panel/vhost/cert/pwn1337password.software/privkey.pem;
  17.     ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  18.     ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  19.     ssl_prefer_server_ciphers on;
  20.     ssl_session_cache shared:SSL:10m;
  21.     ssl_session_timeout 10m;
  22.     add_header Strict-Transport-Security "max-age=31536000";
  23.     error_page 497  https://$host$request_uri;
  24.     #SSL-END
  25.     #ERROR-PAGE-START  Error page configuration, allowed to be commented, deleted or modified
  26.     #error_page 404 /404.html;
  27.     #error_page 502 /502.html;
  28.     #ERROR-PAGE-END
  29.     #PHP-INFO-START  PHP reference configuration, allowed to be commented, deleted or modified
  30.     #Clear cache
  31.     location ~ /purge(/.*) {
  32.         proxy_cache_purge cache_one $host$1$is_args$args;
  33.         #access_log  /www/wwwlogs/pwn1337password.software_purge_cache.log;
  34.     }
  35.         #Referenced reverse proxy rule, if commented, the configured reverse proxy will be invalid
  36.         include /www/server/panel/vhost/nginx/proxy/pwn1337password.software/*.conf;
  37.         include enable-php-00.conf;
  38.     #PHP-INFO-END
  39.     #REWRITE-START URL rewrite rule reference, any modification will invalidate the rewrite rules set by the panel
  40.     include /www/server/panel/vhost/rewrite/pwn1337password.software.conf;
  41.     #REWRITE-END
  42.     # Forbidden files or directories
  43.     location ~ ^/(.user.ini|.htaccess|.git|.svn|.project|LICENSE|README.md)
  44.     {
  45.         return 404;
  46.     }
  47.     # Directory verification related settings for one-click application for SSL certificate
  48.     location ~ .well-known{
  49.         allow all;
  50.     }
  51.     access_log  /www/wwwlogs/pwn1337password.software.log;
  52.     error_log  /www/wwwlogs/pwn1337password.software.error.log;
  53. }
  54.     location / {
  55.         proxy_pass http://127.0.0.1:6666;
  56.         proxy_set_header Host $host;
  57.         proxy_set_header X-Real-IP $remote_addr;
  58.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  59.         proxy_set_header X-Forwarded-Proto $scheme;
  60.     }
  61.   
  62.     location /notifications/hub {
  63.         proxy_pass http://127.0.0.1:3012;
  64.         proxy_set_header Upgrade $http_upgrade;
  65.         proxy_set_header Connection "upgrade";
  66.     }
  67.   
  68.     location /notifications/hub/negotiate {
  69.         proxy_pass http://127.0.0.1:6666;
  70.     }

复制代码

???
我没记错的话这是反代设置吧
你去改Nginx的设置能对就有鬼了
用docker吧 官方不都有教程

白歌 发表于 2021-11-9 09:44
???
我没记错的话这是反代设置吧
你去改Nginx的设置能对就有鬼了

大佬怎么说?我应该在哪设置?

walsh 发表于 2021-11-9 09:54
用docker吧 官方不都有教程

我用的就是docker

语法错误

pwntester 发表于 2021-11-9 10:00
大佬怎么说?我应该在哪设置?

我记得是先pull了docker之后安装,你用宝塔得先去新建一个站,然后设置反向代理代理你docker我看是跑在6666端口吧,你就反代本地的6666端口,然后你想修改的是可以即使同步,就应该在反向代理的设置里面删掉添加这个规则,而不是直接去改Nginx的config

要这么说还搞不明白,我建议你放弃

建议你来和我拼车1password,看我签名还有2个位置。
自建bitwarden 运维很麻烦的,可以看我博客写了一篇讲配置细节的文章,写完我就决定付钱上车1password了