docker nginx appear "502".1 upstream server temporarily disabled while connecting to upstream

Viewed 23195

I use nginx in the docker,this is my nginx configure

server {    listen  80;     server_name saber;

    location / {        
       root /usr/share/nginx;       
       index index.html;
}

    location /saber {       
        proxy_pass http://localhost:8080;   
        proxy_redirect off;     
        proxy_set_header Host $host;    
        proxy_set_header X-Real-IP $remote_addr;        
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        
        proxy_buffer_size 4k;       
        proxy_buffers 4 32k;        
        proxy_busy_buffers_size 64k;    
        proxy_connect_timeout 90;   
    }

}

when I use "http://localhost/saber/blog/getBlog.do" in browser ,browser give me a error with "502". and nginx`s error.log have new.

2017/07/09 05:16:18 [warn] 5#5: *1 upstream server temporarily disabled while connecting to upstream, client: 172.17.0.1, server: saber, request: "GET /saber/blog/getBlog.do HTTP/1.1", upstream: "http://127.0.0.1:8080/saber/blog/getBlog.do", host: "localhost"

I can promise the "http://127.0.0.1:8080/saber/blog/getBlog.do" have response success in browser. I try search answer in other question,i find a answer is "/usr/sbin/setsebool httpd_can_network_connect true",this is question url "nginx proxy server localhost permission denied",but I use the docker in win10,the nginx container dont hava setsebool,because the container dont find SELinux. This all,Thank you in advance.

1 Answers
Related