我有运行的服务(docker注册表),port 5000已经安装了nginx来将http请求从重定向8080到5000。如果我进行卷曲,localhost:5000则可以,但是当我进行卷曲时,localhost:8080会收到错误的网关错误。
Nginx配置文件:
upstream docker-registry {
 server localhost:5000;
}
server {
 listen 8080;
 server_name registry.mydomain.com;
 proxy_set_header Host       $http_host; 
 proxy_set_header X-Real-IP  $remote_addr; 
 client_max_body_size 0; 
 chunked_transfer_encoding on;
 location / {
     proxy_pass http://docker-registry;
 }
 location /_ping {
     auth_basic off;
     proxy_pass http://docker-registry;
 }
 location /v1/_ping {
     auth_basic off;
     proxy_pass http://docker-registry;
 }
}
在/var/log/nginx/error.log我有:
[crit] 15595#0: *1 connect() to [::1]:5000 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: registry.mydomain.com, request: "GET / HTTP/1.1", upstream: "http://[::1]:5000/", host: "localhost:8080"
任何想法?
                  以我为例,我正在使用的代理服务在我使用它的过程中死了(并且我没有意识到)。一秒钟我正在访问它,下一秒钟我访问了错误的网关。我不得不重新启动服务。
                
                
                  
                    —
                    迈克尔·普劳兹