[英]Apache running static content and flask app
I have a Flask app running via wsgi
. 我有一个通过
wsgi
运行的Flask应用程序。
To lesson the load on my app, which loads a lot of stuff, I would like to serve up my home page, or root url via apache, but I am getting conflicts trying to send "/" a static index file via apache, and then everything else to wsgi
: 为了加载我的应用程序上的负载,它加载了很多东西,我想通过apache提供我的主页或root url,但是我遇到冲突试图通过apache发送“/”静态索引文件,并且那么
wsgi
其他一切:
<VirtualHost *:80>
ServerName www.yada.com
Alias /static /home/ubuntu/yada/static
<Location /static>
SetHandler None
</Location>
WSGIDaemonProcess yada
WSGIScriptAliasMatch /.+ /home/ubuntu/yada/wsgi.py
<Directory /home/ubuntu/yada>
RewriteEngine On
RewriteRule ^/$ /static/html/index.html [L]
WSGIProcessGroup postwire
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
</Directory>
</VirtualHost>
Any help? 有帮助吗?
See the AddHandler/mod_rewrite solution at end of section: 请参阅末尾部分的AddHandler / mod_rewrite解决方案:
http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.