java - Apache 和 Nginx(每个都作为反向代理)对自签名后端证书具有非常不同的行为
问题描述
我在我的 UAT 环境中的 Nginx 和 Apache http 服务器(作为反向代理 Web 服务器)上部署 Angular,后端在 Apache Tomcat 上的 spring boot 上(使用 https 为 java REST apis 加密),我注意到 Nginx 被配置为反向代理比 Apache 容易得多,但这主要是因为 Apache 不信任 Java API 证书(因为它是自签名的,所以这似乎是正确的)
有人可以解释为什么会这样吗?我相信 Nginx 是安全的,但我想知道为什么它允许这个自签名证书,而 Apache 默认阻止它(只允许它使用 SSLProxyVerify none)?
Nginx 配置(相关部分):
location /api {
proxy_pass https://192.168.170.78:7002/;
}
Apache 配置(相关部分):
# SSL proxy config
SSLProxyEngine on
# Why this must be present for the apache to connect to the backend but not for nginx?
SSLProxyCheckPeerName off
# the (proxy) redirection rules for the server
ProxyPass /api/ https://192.168.170.78:7002/
ProxyPassReverse /api/ https://192.168.170.78:7002/
解决方案
推荐阅读
- arrays - 由于字符串存储为字符数组,那么为什么在这个问题中存储字符串而不初始化字符数组?
- mysql - MySQL - 如何从列中列出 JSON 数据的所有键名
- sql-server - PowerShell - 如果所有 Invoke-SQL 命令都成功,如何提交范围
- python - 使用命令为多个用户分配角色 - discord.py
- javascript - 通过 JS 的样式底部和左侧计算不起作用
- javascript - React + TypeScript:滚动事件类型不可分配给 window.addEventListener
- javascript - WebSocket connection.send 只触发一次
- javascript - 根据清单应用流程并单击按钮
- html - 从 ACF 组中获取字段作为 vars
- flutter - 如何在 Flutter 中播放 Google Drive 中的音乐(mp3、m4a 等)