apache - 是否可以将 https 请求重定向到 http 端点?
问题描述
我需要测试一个应用程序。它是一个使用其他 API 的微服务。为了单独测试它,我想使用模拟服务器。问题是我无法将被测应用程序配置为向 http 模拟服务器发送请求。它仅使用 https 协议和端口 443 发送请求。但是,该端口上没有运行 https-app。但是可以指定代理服务器。我试图将 apache 配置为作为 https 代理服务器运行。此服务器使用 localhost 域的自签名证书。但是重定向不适用于 https 请求。但是,如果我在 http 模式下运行代理服务器,http 请求会成功重定向。这是代理服务器的配置:
<VirtualHost localhost:8098>
ProxyRequests Off
SSLEngine On
ProxyPass / http://localhost:3001
ProxyPassReverse / http://localhost:3001
SSLCertificateFile localhost.crt
SSLCertificateKeyFile localhost.key
</VirtualHost>```
解决方案
推荐阅读
- php - preg_match() 不匹配 img src
- html - HTML 保存按钮,复选框保持状态
- c# - C#以类的另一种形式在标签中显示Json变量
- vb.net - Accessviolationexception 在保存文件对话框中未处理 vb.net
- c# - 如何有条件地获取上下文 ASP.NET Core WebAPI 上的值
- php - 使用 mysql 连接数据库时出现 Sql 语法错误
- node.js - 在 Firebase Firestore 上查询文档时获取空查询
- python - 如何将 LIVE API 调用转换为熊猫数据框
- mongodb - 能够从我的命令行连接到远程 mongodb atlas 集群,但不能从 docker app
- python - Pandas 数据排序/转置