You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

本地连接开启IAM认证的AWS Neptune集群遇403问题排查

连接开启IAM认证的AWS Neptune集群时遭遇403 AccessDeniedException问题

架构说明

  • ALB设置为接收本地IP的入站流量,并转发至EC2实例
  • EC2实例位于Neptune集群所在的VPC中,允许来自ALB的流量
  • EC2实例上配置Nginx反向代理,将请求转发至Neptune写入端点

问题现象

  • 未开启IAM认证时,该架构可正常工作
  • 开启IAM认证后,收到Neptune集群返回的403响应,错误信息为"code": "AccessDeniedException"
  • 使用Gremlin .Net客户端通过ws://{ALB_IP_ADDRESS}:{ALB_PORT}可建立连接,但使用wss协议时会出现The SSL connection could not be established错误
  • Gremlin客户端代码在云端环境运行正常,但本地运行返回403响应

已做配置

  • 已发送Neptune要求的所有认证头:Authorization、X-Amz-Date和X-Amz-Security-Token
  • Nginx反向代理配置如下:
server {
    listen 8081;
    location / {
        proxy_pass https://cluster-name.cluster-xyzabc.us-east-1.neptune.amazonaws.com:8182;
        proxy_http_version 1.1;
        proxy_set_header Host cluster-name.cluster-xyzabc.us-east-1.neptune.amazonaws.com;
        proxy_set_header Connection "upgrade";
        proxy_buffers           32 4m;
        proxy_busy_buffers_size     25m;
        proxy_buffer_size 512k;
        proxy_ignore_headers "Cache-Control" "Expires";
        proxy_max_temp_file_size 0;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        client_max_body_size        1024m;
        client_body_buffer_size     4m;
        proxy_connect_timeout 300;
        proxy_read_timeout 300;
        proxy_send_timeout 300;
        proxy_intercept_errors off;
        proxy_pass_request_headers      on;
    }
 }

疑问

我遗漏了什么配置?看起来是代理未将部分请求头转发至Neptune集群的问题。

内容的提问来源于stack exchange,提问作者S7H

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 12:52:29