django - 如何使用 mod_wsgi 和 SSL 将 Http 协议定向到 Django 中的 Https 协议?
问题描述
我正在使用 mod_wsgi 运行我的 Django API,但它运行在 HTTP 协议上。我希望它在 HTTPS 协议中运行,但我不知道如何在 Dockerfile 中安装/配置 SSL。我已经搜索了为我的 Django API 实现 SSL,但我找不到任何使用 mod_wsgi 的 dockerized Django 应用程序的示例。
Dockerfile:
FROM python:3
RUN echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen
ENV LANG=en_US.UTF-8 LC_ALL=en_US.UTF-
COPY ./requirements.txt /requirements.txt
RUN pip install --no-cache-dir -r /requirements.txt
WORKDIR /opt/app-root
COPY . /opt/app-root
EXPOSE 80
CMD ["mod_wsgi-express", "start-server", "--port", "80", "--threads","20","--processes","5","--user","www-data", "--group", "www-data", "--log-to-terminal", "/opt/app-root/mysite/wsgi.py"]
这个站点描述了在 mod_wsgi 中 OpenSSL 的实现,但我不知道如何在 Dockerfile 中使用它。请在这件事上给予我帮助
解决方案
推荐阅读
- .net - ASP.NET MVC 5 项目文件夹中缺少脚本文件夹
- javascript - 如何使用javascript中的提示输入在对象类中添加新对象
- c++ - 如何在 g++ 10 中使用范围?
- excel - 关于如何将硬编码值转换为变量的 VBA Excel 宏问题
- java - 在 .m2 中配置 maven 注册表
- discord - 将消息复制并发送到另一个频道后删除
- ansible - 使用 ansible 在 tmux 中运行服务器
- javascript - (已更新)尝试使用嵌套表在 tablesorter 中编辑切换功能的行为
- c++ - C++ 未定义的引用错误,同时使用标头
- javascript - 如何在 JSX 中映射()?错误:渲染没有返回任何内容。这通常意味着缺少 return 语句。或者,不渲染任何内容,返回 null