简体   繁体   English

Docker 与 NGINX 反向代理 Flask 应用程序

[英]Docker with NGINX Reverse Proxy for a Flask app

I'm currently learning how to host websites and manage servers and especially how to host multisites inside a VPS.我目前正在学习如何托管网站和管理服务器,尤其是如何在 VPS 中托管多站点。 So I'm trying to set up a reverse proxy with jwilde/nginx-proxy.所以我正在尝试使用 jwilde/nginx-proxy 设置反向代理。 But what I'm trying to understand is:但我想了解的是:

  • Do the Reverse-Proxy will also be the web server for every app?反向代理是否也将成为每个应用程序的 web 服务器? Or whenever I want to add an app via a container I have to launch an other web server (See Annexe 1)或者每当我想通过容器添加应用程序时,我必须启动另一个 web 服务器(参见附件 1)

Annexe 1附件 1 附件 1

My current setup is:我目前的设置是: 在此处输入图像描述

Do you have any ideas?你有什么想法?

I would suggest having a single container for your nginx reverse proxy, and only include nginx (or whatever other listener) where your other containers need one.我建议为您的 nginx 反向代理使用一个容器,并且只包括 nginx (或任何其他侦听器),您的其他容器需要一个。 You may have an opportunity to proxy_pass traffic directly to your Flask application without another nginx server.您可能有机会将流量直接代理传递到您的 Flask 应用程序,而无需其他 nginx 服务器。

However, your current setup and Annexe1 could be correct: you have the flexibility to use any host:port accepting traffic in your containers.但是,您当前的设置和 Annexe1 可能是正确的:您可以灵活地使用任何 host:port 接受容器中的流量。 It could even be another reverse proxy~ As long as your proxy_pass your traffic from your Reverse Proxy nginx to an appropriate listener.它甚至可以是另一个反向代理~只要你的 proxy_pass 你的流量从你的反向代理 nginx 到适当的监听器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过Nginx / uswgi反向代理启动我的Flask应用 - How to launch my flask app via nginx/uswgi reverse proxy Docker 和 Nginx 上的 uwsgi 作为反向代理 - uwsgi on Docker and Nginx as reverse proxy 使用 docker-compose 的 python 应用程序的 Nginx 反向代理 - Nginx reverse-proxy for python app using docker-compose Flask-使用Nginx隐藏在反向代理后面的SocketIO - Flask - SocketIO hidden behind reverse proxy with Nginx Nginx反向代理配置的问题,用于为多个Django应用程序Docker容器提供服务 - Troubles with nginx reverse proxy configuration for serving multiple Django app docker containers 使用 Flask-Login 验证 Nginx 反向代理 - Using Flask-Login to Authenticate Nginx Reverse Proxy 检查代理集标头是否被nginx反向代理(Django应用)所覆盖 - Checking proxy set header forwaded by nginx reverse proxy (Django app) Nginx反向代理到运行Nginx + django的应用程序服务器的问题 - Issues with nginx reverse proxy to an app server running nginx+django docker 中的 Nginx、fastapi 和 streamlit - 反向代理不适用于 streamlit - Nginx, fastapi and streamlit in docker - reverse proxy does not work for streamlit 在Docker容器中使用uwsgi和nginx设置Flask应用 - Setting flask app with uwsgi and nginx in docker container
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM