nginx反向代理背后的neo4j webinterface

 mobiledu2502908197 发布于 2023-01-12 10:21

我正在尝试将neo4j数据库暴露给互联网.

出于安全考虑,我想通过nginx将其隐藏在SSL/basic_auth组合后面.这是相应的nginx配置:

  location /neo4j/ {
            proxy_pass https://localhost:7473/;
            proxy_read_timeout 600;

            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_set_header    Host              $http_host;
            proxy_buffering     off;
            proxy_redirect      off;
            auth_basic           "restricted";
            auth_basic_user_file /etc/nginx/auth/htpasswd;
            proxy_headers_hash_max_size 1024;
            proxy_headers_hash_bucket_size 128;
            proxy_ssl_session_reuse off;
            rewrite /neo4j/(.*) /$1 break;
    }

虽然我可以访问https://example.com/neo4j/browser,webinterface告诉我,它无法连接到neo4j,我的webbrowser的控制台被填满了OPTIONS https://example.com/db/data 405(Not allowed)

我还尝试了内置在https服务器中的neo4j以及身份验证扩展(https://github.com/neo4j-contrib/authentication-extension).使用此选项,我还可以访问Web界面.

但是界面还显示,它无法连接到neo4j并且webbrowser的控制台被填满OPTIONS http://example.com:7473/db/data/ net::ERR_EMPTY_RESPONSE并且提示The page at 'https://example.com:7473/browser/' was loaded over HTTPS, but displayed insecure content from 'http://example.com:7473/db/data/': this content should also be loaded over HTTPS.

有谁知道,如何使它工作?提前谢谢了!

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有