nginx: ошибка подключения () (111: соединение отклонено) при подключении к восходящему каналу для настройки Docker - PullRequest
0 голосов
/ 16 января 2020

У меня 2 Java Приложение работает на портах 8084 и 8085 URL для сервера - http://127.0.0.1:8085/hello/adi

NGINX Конфигурация ::

/ etc / nginx / conf.d / default.conf -

 upstream my-app1 { 
    server 127.0.0.1:8085; 
} 

upstream my-app2 { 
    server 0.0.0.0:8084; 
}

server { 
  listen 80; 
  server_name  localhost; 
    location / { 
        root   /usr/share/nginx/html; 
        index  index.html index.htm; 
     } 

   location /hello { 
     proxy_pass http://my-app1/hello/adi; 
   } 
   location /helloin { 
     proxy_pass http://my-app2/helloin/helloin/adi; 
   } 
 }

/ etc / nginx / nginx .conf -

user  nginx; 
worker_processes  1;

error_log  /var/log/nginx/error.log warn;

user  nginx;
worker_processes  1; 

error_log  /var/log/nginx/error.log warn; 
pid        /var/run/nginx.pid; 


events { 
    worker_connections  1024; 
} 


http { 
    include       /etc/nginx/mime.types; 
    default_type  application/octet-stream; 

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ' 
                      '$status $body_bytes_sent "$http_referer" ' 
                      '"$http_user_agent" "$http_x_forwarded_for"'; 

    access_log  /var/log/nginx/access.log  main; 

    sendfile        on; 
    #tcp_nopush     on;

Я вижу это ошибка:

[ошибка] 7 # 7: * 1 connect () не удалось (111: соединение отклонено) при подключении к восходящему каналу, клиент: 172.17.0.1, сервер: localhost, запрос: «GET / привет HTTP / 1.1 ", восходящий поток:" http://127.0.0.1: 8085 / hello / adi", хост:" 0.0.0.0:8080"

...