Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache在服务器上提供不同的HTTPS vhost,而不是请求的vhost_Apache_Amazon Linux - Fatal编程技术网

Apache在服务器上提供不同的HTTPS vhost,而不是请求的vhost

Apache在服务器上提供不同的HTTPS vhost,而不是请求的vhost,apache,amazon-linux,Apache,Amazon Linux,site1.com未启用https且未安装SSL证书。 site2.com确实启用了https。 当站点访问者请求时,他们会收到SSL证书不匹配错误,如果他们单击“继续”,则会将其发送到 由于site1.com没有SSL证书,在删除https的同时,我可以对任一主机做什么,将流量重定向回site1.com 我在site2.com的.htaccess文件中尝试了这个 RewriteEngine on #if the request is actually for site1 forward the

site1.com未启用https且未安装SSL证书。 site2.com确实启用了https。 当站点访问者请求时,他们会收到SSL证书不匹配错误,如果他们单击“继续”,则会将其发送到

由于site1.com没有SSL证书,在删除https的同时,我可以对任一主机做什么,将流量重定向回site1.com

我在site2.com的.htaccess文件中尝试了这个

RewriteEngine on
#if the request is actually for site1 forward them to site1
RewriteRule "^site1.com" "http://site1.com" [R]
#if the request is actually for site1 (with www prefix) forward them to site 1
RewriteRule "^www.site1.com" "http://site1.com" [R]

获取site1.com的SSL证书。letsencrypt提供免费证书,没有理由不提供。也有很多理由这样做——意外的行为是,Apache将访问者发送到site2.com,而他们没有请求该站点。我想停止这种行为。如何将apache配置为不向错误站点提供服务器?问题是,该站点是唯一配置为接受端口443上的连接的站点。在你的IP上任何/每个指向端口443的名字都会得到site2.com…这是正确的,也是我问题的核心。Apache是否有纠正这种行为的机制?我希望请求的来源(site1.com)对最终结果(为site2.com的内容提供服务)应该是显而易见的,这样您就可以重定向或修改请求实现的行为。