【发布时间】:2014-02-22 20:33:43
【问题描述】:
我们有一个 PHP 平台作为 AWS SNS 服务的客户端。 我们在后端使用 NGINX 作为 Apache 2 的代理。
当通知通过端口 80 (HTTP) 发送时,这可以正常工作。 我们最近实施了 SSL 证书来更好地模拟我们的生产环境。 我们在 AWS SNS 控制台中使用 HTTPS 协议进行了新订阅,但订阅消息从未到达 PHP 后端。它在途中的某个地方被挡住了。
我们无法从 NGINX 访问日志中检索到任何答案。 我们看到以下行我们怀疑来自 SNS(IP 解析到亚马逊网络内的某个位置)
54.240.197.67 - - [10/Feb/2014:10:49:42 +0000] "-" 400 0 "-" "-"
54.240.197.2 - - [10/Feb/2014:10:50:03 +0000] "-" 400 0 "-" "-"
62.75.187.88 - - [10/Feb/2014:10:50:07 +0000] "-" 400 0 "-" "-"
54.240.197.65 - - [10/Feb/2014:10:50:23 +0000] "-" 400 0 "-" "-"
54.240.197.35 - - [10/Feb/2014:10:51:48 +0000] "-" 400 0 "-" "-"
54.240.197.66 - - [10/Feb/2014:10:52:09 +0000] "-" 400 0 "-" "-"
54.240.197.35 - - [10/Feb/2014:10:52:30 +0000] "-" 400 0 "-" "-"
54.240.197.33 - - [10/Feb/2014:10:52:51 +0000] "-" 400 0 "-" "-"
我们的 NGINX 配置如下所示
listen 443;
root /var/www/example_dev/public/;
index index.php index.html index.htm;
server_name dev.example.com;
client_max_body_size 20M;
ssl on;
ssl_certificate /etc/nginx/ssl/dev.example.com/dev.example.com.crt;
ssl_certificate_key /etc/nginx/ssl/dev.example.com/dev.example.com.key;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/nginx.dev_example_com.access.log;
error_log /var/log/nginx/nginx.dev_example_com.error.log;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
location ~ /\.ht {
deny all;
}
我们有一种预感,我们使用的证书的 CA 可能不受 AWS 信任,但您如何确认这一点? CA PositiveSSL CA 2,根 CA AddTrust 外部 CA 根
也许问题出在 NGINX 配置中?
提前致谢!
更新
似乎是 SSL 证书问题。将 CA 根证书添加(连接)到域证书后,SNS 通知可能会到达服务器。但是,它只命中了 NGINX 配置中首先列出的子域。 在处理了域的顺序之后,我在配置文件中较低的子域中发现了一个错误。 现在一切正常。如果没有提供 CA Root 证书,我怀疑 AWS SNS 不会查找它们。
【问题讨论】:
-
你应该把你的答案作为答案并接受它。
-
好的,谢谢回复。
标签: amazon-web-services nginx https amazon-sns