当我调用https://new.sample.com时,我得到了https://sample.com的页面, 但http://new.sample.com得到了正确的页面
sample.com 配置文件
<VirtualHost xx.xx.xx.xx:80>
ServerName sample.com
WSGIScriptAlias / /path/to/my/project/sample.wsgi
</VirtualHost>
<VirtualHost xx.xx.xx.xx:443>
ServerName www.sample.com
SSLEngine ON
SSLCertificateFile /etc/apache2/ssl/mycerficate.crt
SSLCertificateKeyFile /etc/apache2/ssl/mykey.key
SSLCertificateChainFile /etc/apache2/ssl/mychain.crt
# Django settings
WSGIScriptAlias / /path/to/my/project/wsgi.py
<Directory /path/to/my/project/>
Options -Indexes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
new.sample.com 配置文件
<VirtualHost xx.xx.xx.xx:80>
ServerName new.sample.com
ServerAlias new.sample.com
WSGIPassAuthorization On
# Django settings
WSGIScriptAlias / /path/to/my/project/wsgi_new.py
</VirtualHost>
目前,您只有一个虚拟主机配置用于对端口 443 的请求。如果不存在特定的虚拟主机
Hostname:
,Apache 将使用为该特定IP 地址/端口号组合配置的第一个虚拟主机响应 HTTP 请求。new.sample.com
您需要为在端口 443 上侦听的主机名创建虚拟主机配置: