我正在尝试将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.
有谁知道,如何使它工作?提前谢谢了!