我正在本地ubuntu机器上运行HAproxy作为容器,基于以下指南:
https://hub.docker.com/_/haproxy/
我现在正试图访问
stats
在“我的浏览器”中的页面:
http://localhost:8443/haproxy?stats
http://localhost/haproxy?stats
https://localhost:8443/haproxy?stats
但以上都给出了:
ERR_CONNECTION_REFUSED
在我的
我有文件:
global
maxconn 1000
ca-base /var/lib/haproxy/certs
crt-base /var/lib/haproxy/certs
tune.ssl.default-dh-param 2048
defaults
maxconn 1000
timeout connect 130s
timeout client 130s
timeout client-fin 111s
timeout server 130s
timeout server-fin 111s
timeout http-request 130s
timeout http-keep-alive 300s
# Long timeout for WebSocket connections.
timeout tunnel 1h
log global
mode http
option forwardfor
option http-server-close
option httplog
stats enable
stats uri /stats
stats realm Haproxy\ Statistics
stats auth user:password
frontend haproxy
bind :8443 ssl crt frontend/server.pem
reqadd X-Forwarded-Proto:\ http
default_backend myapp
backend myapp
server myapp localhost:9000
backend myapp
server myapp localhost:9000
没有真正的效果。如果我更改为:
backend myapp
server myapp 199.17.0.2:9000
我仍然可以进入
我的应用程序
在本地主机上:9000。那么在后端部分指定URL的目的是什么?
我跑
使用:
docker run -d --name myapp -p 9000:9000 -p 9092:9092 myapp
单倍体
使用:
docker run -d --name my-running-haproxy -p 8443:8443 my-haproxy:1.7
https://localhost:8443/stats