Tôi có một dịch vụ (docker registry) chạy trên port 5000, tôi đã cài đặt nginx để chuyển hướng yêu cầu http từ 8080đến 5000. Nếu tôi thực hiện cuộn tròn để localhost:5000nó hoạt động, nhưng khi tôi thực hiện cuộn tròn để localhost:8080tôi gặp lỗi Cổng xấu .
tập tin cấu hình 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;
}
}
Trong /var/log/nginx/error.logtôi có:
[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"
Bất kỳ ý tưởng?