【发布时间】:2021-12-28 11:19:17
【问题描述】:
我有一个在 ubuntu 上运行的烧瓶服务器。我想使用我的域名 test.example.com 访问服务器,而不必包含端口号。现在,我可以通过 https://test.example.com:80/ 成功访问服务器,但我不知道该怎么做 https://test.example.com/
在flask_server.py中:
if __name__ == '__main__':
app.run(host=0.0.0.0, port=80, ssl_conext=context)
【问题讨论】:
-
https 端口默认不是 80,而是 443。所以你强制烧瓶在 80 上监听,然后在 URL 中必须使用端口。不要设置任何东西,你会没事的或设置为443。
-
flask 开发服务器不是首选的生产服务器。使用像 gunicorn / waitress 这样的 WSGI 服务器,并使用像 nginx 这样的前端代理服务器来处理 SSL
标签: python-3.x ubuntu flask