免责声明:我真的不知道我在做什么,所以我可能说错了.我以前从未在这里问过/回答过一个问题!
我在Apache上运行了一个Django应用程序,我使用mod_wsgi和virtualenv进行部署.我希望应用程序的某些部分使用SSL,但是当我安装SSL证书时,https URL从我的public_html文件夹而不是app(在public_html之外)转到index.html文件
例如,访问https://tradekandi.com.该URL只是一个基本的HTML文件:public_html/index.html然后访问http://tradekandi.com.那是我的Django页面(在维护模式下).
我整天都在搜索stackoverflow和Google.我已经尝试从虚拟主机文件中删除了文档,但没有做任何事情.我尝试添加一个SetEnvIf X-Forwarded-Proto https HTTPS = 1行,但它也没有做任何事情.
我的虚拟主机文件中包含以下行:
SSLEngine on
SSLCertificateFile /etc/ssl/certs/tradekandi.com.crt
SSLCertificateKeyFile /etc/ssl/private/tradekandi.com.key
SSLCACertificateFile /etc/ssl/certs/tradekandi.com.cabundle
Run Code Online (Sandbox Code Playgroud)
每当我做出任何更改时,我都会重新启动apache并"触摸"应用程序的wsgi文件.
如何使https URL加载Django应用程序?任何帮助将非常感激.谢谢.
更多httpd配置:
<VirtualHost 69.65.42.153:80>
ServerName tradekandi.com
ServerAlias www.tradekandi.com
DocumentRoot /home/trade/public_html
ServerAdmin webmaster@tradekandi.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/tradekandi.com combined
CustomLog /usr/local/apache/domlogs/tradekandi.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User trade # Needed for Cpanel::ApacheConf
<IfModule mod_suphp.c>
suPHP_UserGroup trade trade
</IfModule>
<IfModule !mod_disable_suexec.c>
SuexecUserGroup trade trade
</IfModule>
ScriptAlias /cgi-bin/ /home/trade/public_html/cgi-bin/
Include "/usr/local/apache/conf/userdata/*.conf"
Include "/usr/local/apache/conf/userdata/*.owner-root"
Include "/usr/local/apache/conf/userdata/std/*.conf"
Include "/usr/local/apache/conf/userdata/std/*.owner-root"
Include …Run Code Online (Sandbox Code Playgroud)