Hi,
I'm seeing a small but maybe relevant difference between your Prometheus
config and your test case: The Prometheus config uses "localhost" while
your test uses a hostname. This may not matter network-wise if your
service is bound to both these addresses. However, it may matter
HTTP-wise as these can be interpreted as different virtual hosts by the
target web servers.
I suggest trying to use the hostname instead of localhost in Prometheus.
If that doesn't work either, it might be some more buried difference
(e.g. headers), although that would sound like an uncommon reason for a
404 error. A tcpdump/wireshark comparison of both requests might help there.
Kind regards,
Christian