Flask应用程序在通过mod_wsgi部署时忽略基本URL路径

时间:2014-10-16 14:27:08

标签: apache flask mod-wsgi

我已经通过mod_wsgi / apache成功部署了Flask应用程序并且可以获得渲染的基本路径,但是没有链接附加到基本URL,导致404错误。

例如:

我希望如此:http://hostname.com/script-runner/[flask-route]
但是我得到了这个:http://hostname.com/[flask-route]

这是我的设置:

文件夹结构

script-runner/
├── script_runner.wsgi
├── script_runner.py
└── templates/

script_runner.wsgi

import sys
import logging
sys.path.insert(0, '/usr/local/apps/script-runner')
from script_runner import app as application
sys.stdout = sys.stderr
logging.basicConfig(stream = sys.stderr)

script_runner.conf

WSGIDaemonProcess script-runner user=username group=usernamethreads=5
WSGIProcessGroup script-runner
WSGIScriptAlias /script-runner /usr/local/apps/script-runner/script-runner.wsgi

SetEnvIf Request_URI "^/script-runner.*$" script-runner_app
CustomLog /usr/local/apps/script-runner/access.log common env=script-runner_app

修改
添加apache错误日志,然后加载相关链接:

File does not exist: /var/www/html/domain-value, referer: http://10.3.64.250/script-runner

所以似乎apache正在寻找错误的目录......?

0 个答案:

没有答案