【发布时间】:2020-11-16 06:54:24
【问题描述】:
我在 cPanel 中设置了一个 python 应用程序。我已将应用程序 URL 设置为 backend,当我查询 mydomain.com/backend/ 时,它会返回应用程序的根视图(这只是一个 html “你好”)。
其余端点是我需要的,但我在每个其他 URL 上都返回 404
@app.route('/')
def hello_world():
logger.debug("Hi there")
return "<h1 style='color:red'>Hi there</h1>"
@app.route('/test', methods=['POST','GET'])
def test():
logger.info("Got test request")
return {'ok' : 'success!'}
mydomain.com/backend/ --> Hi there
mydomain.com/backend/test --> 404
mydomain.com/backend/<any_other> --> 404
我敢打赌,在到达脚本之前,还有其他一些服务会返回 404。我在public_html/.htaccess 中找不到对backend/ 的任何引用。依赖关系没问题(没有包抱怨)。
我在服务器上的权限非常有限。任何指针将不胜感激。
谢谢!
Ps 发现a similar question 没有答案
【问题讨论】:
-
没有。我相信我的问题特别与映射应用程序的 cpanel 方式有关。