【发布时间】:2020-02-20 10:45:50
【问题描述】:
我有以下 apache 配置文件
<VirtualHost *:443>
ServerName example.io
ServerAlias *.*
Alias /static /var/www/user/master/workbench/workbench/static
DocumentRoot /var/www/user/master/workbench/workbench/static
# Redirect naked URL to the specified URL
# RedirectMatch ^/$ http://other-example.io
# Load custom index page as homepage
AliasMatch ^/$ /var/www/user/master/workbench/scnv_home
WSGIDaemonProcess example.io processes=1 threads=5 python-path=/var/www/user/master/workbench:/home/ubuntu/.virtualenv/app/lib/python2.7/site-packages/
WSGIProcessGroup example.io
WSGIScriptAlias / /var/www/user/master/workbench/workbench/wsgi.py
<Directory /var/www/user/master/workbench/workbench/static >
Order deny,allow
Allow from all
AllowOverride All
</Directory>
</VirtualHost>
该域用于使用 WSGI 访问 Django 站点,RedirectMatch 配置选项用于将用户重定向到其他域。
https://example.io -> Redirects to http://other-example.io
https://example.io/path # Served by Django
现在我想显示一个自定义的index.html 页面,而不是将用户重定向到其他域。
为此,我尝试使用AliasMatch 选项指向存在index.html 文件的目录,但它仍然由Django 提供服务并提供404 Django 页面。
如果 url 有路径,我如何设置 apache 以通过 Django 处理请求,否则加载自定义索引页面?
【问题讨论】:
-
我想知道您是否使用 SSL?
-
你想知道什么?
-
我想知道您是否使用 SSL?
-
是的,我确实使用 SSL。