У меня есть настройка веб-сервера Actix, работающая внутри контейнера Docker. Вы можете просмотреть docker-compose.yml
здесь .
Я хочу направлять запросы / ответы от веб-сервера actix с помощью Traefik и получать к ним доступ с хост-компьютера.
Я вижу ответ whoami
, используя curl -H Host:whoami.docker.localhost http://127.0.0.1
. Когда я делаю curl -H Host:questionnaire.local http://127.0.0.1
ИЛИ curl -H Host:questionnaire.local:8088 http://127.0.0.1
, я получаю ответ 502 Bad Gateway
.
Я не уверен, как отладить и исправить проблему. Любая помощь приветствуется.
Это журнал, который я вижу, когда делаю запрос в Actix:
reverse-proxy_1 | time="2019-01-09T03:39:58Z" level=debug msg="vulcand/oxy/roundrobin/rr: begin ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.54.0\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"questionnaire.local\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.22.0.1:53184\",\"RequestURI\":\"/\",\"TLS\":null}"
reverse-proxy_1 | time="2019-01-09T03:39:58Z" level=debug msg="vulcand/oxy/roundrobin/rr: Forwarding this request to URL" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.54.0\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"questionnaire.local\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.22.0.1:53184\",\"RequestURI\":\"/\",\"TLS\":null}" ForwardURL="http://172.22.0.4:8088"
reverse-proxy_1 | time="2019-01-09T03:39:58Z" level=debug msg="vulcand/oxy/forward: begin ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"http\",\"Opaque\":\"\",\"User\":null,\"Host\":\"172.22.0.4:8088\",\"Path\":\"\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.54.0\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"questionnaire.local\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.22.0.1:53184\",\"RequestURI\":\"/\",\"TLS\":null}"
reverse-proxy_1 | time="2019-01-09T03:39:58Z" level=debug msg="vulcand/oxy/forward/http: begin ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"http\",\"Opaque\":\"\",\"User\":null,\"Host\":\"172.22.0.4:8088\",\"Path\":\"\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.54.0\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"questionnaire.local\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.22.0.1:53184\",\"RequestURI\":\"/\",\"TLS\":null}"
reverse-proxy_1 | time="2019-01-09T03:39:58Z" level=debug msg="Upstream ResponseWriter of type *pipelining.writerWithoutCloseNotify does not implement http.CloseNotifier. Returning dummy channel."
reverse-proxy_1 | time="2019-01-09T03:39:58Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 172.22.0.4:8088: connect: connection refused"
reverse-proxy_1 | time="2019-01-09T03:39:58Z" level=debug msg="vulcand/oxy/forward/http: Round trip: http://172.22.0.4:8088, code: 502, Length: 11, duration: 2.781098ms"
reverse-proxy_1 | time="2019-01-09T03:39:58Z" level=debug msg="vulcand/oxy/forward/http: completed ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"http\",\"Opaque\":\"\",\"User\":null,\"Host\":\"172.22.0.4:8088\",\"Path\":\"\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.54.0\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"questionnaire.local\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.22.0.1:53184\",\"RequestURI\":\"/\",\"TLS\":null}"
reverse-proxy_1 | time="2019-01-09T03:39:58Z" level=debug msg="vulcand/oxy/forward: completed ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"http\",\"Opaque\":\"\",\"User\":null,\"Host\":\"172.22.0.4:8088\",\"Path\":\"\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.54.0\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"questionnaire.local\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.22.0.1:53184\",\"RequestURI\":\"/\",\"TLS\":null}"
reverse-proxy_1 | time="2019-01-09T03:39:58Z" level=debug msg="vulcand/oxy/roundrobin/rr: completed ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.54.0\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"questionnaire.local\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.22.0.1:53184\",\"RequestURI\":\"/\",\"TLS\":null}"