首页 > 解决方案 > Nginx (113: No route to host) 同时连接到上游

问题描述

# error message
[error] 21#21: *3 connect() failed (113: No route to host) while connecting to upstream,
# nginx/nginx.conf
server {
    listen 1234;
    client_body_buffer_size 10M;
    client_max_body_size 10M;

    location / {
        include uwsgi_params;
        uwsgi_pass flask:900;
    }
}
# docker-compose.yaml
version: "3.7"

services:

  flask:
    build: ./flask
    container_name: flask
    restart: always
    expose:
      - 900

  nginx:
    build: ./nginx
    container_name: nginx
    restart: always
    ports:
      - "80:1234"

你好。我在 EC2 ubuntu 18.04 服务器上制作了两张图片。“构建”和“向上”的过程是成功的。但是,我无法通过 API POST 与本地 PC 建立连接。

最重要的是我的错误消息和主要配置文件。请帮助初学者开发人员.. 非常感谢 Stackoverflowers。

标签: pythonnginxflask

解决方案


推荐阅读