How to view more detailed logging for http request...
# ask-community
m
How to view more detailed logging for http requests received to dashboard? good evening friends. I'm self-hosting a prefect server and had set dashboard to listen on 0.0.0.0 (instead of the default loopback address). I was doing this for debugging purposes while remote and forgot to take down the service after, so it was up for a few days on public web. I took down the service (which was running under an unprivileged user thankfully), but noticed in the server logs (accessible via
journalctl
) that a number of http requests had been received in the few days that it was up. Here's a snippet of logs:
Copy code
Dec 05 08:54:22 localhost.localdomain prefect[3885809]: Check out the dashboard at <http://0.0.0.0:4200>
Dec 06 00:15:25 localhost.localdomain prefect[3885809]: Invalid HTTP request received.
Dec 06 01:32:59 localhost.localdomain prefect[3885809]: Invalid HTTP request received.
[...]
Dec 09 17:28:28 localhost.localdomain prefect[3885809]: Invalid HTTP request received.
Dec 09 17:32:56 localhost.localdomain systemd[1]: Stopping prefect-server.service - Prefect Server...
Unfortunately there's no other information available about the nature of the requests, so it's difficult to tell if they were port-scanning, or just problems with an open tab that refreshed from time to time. Is there any way to view more detailed logs about http requests received and responses set under default configuration, or would I have had to set something differently in my config (and can't get this info now, post-hoc) Cheers, Mira
followup q: any recommended settings to set if I'm hosting the dashboard on public web? Or is this not recommended (eg, instead use ssh tunneling to access the dashboard remote)?
t
I see those
Invalid HTTP request received
errors as well, and I am running a self-hosted prefect server that is not accessible outside my company's private network. I would also be curious to find out whether they are related to prefect flow runs, or just any old network sniffer poking around.
I realised what these
Invalid HTTP request received
messages were. In my case I was trying to hit the https URL, which I have not configured on my self-hosted server. They were automatically redirected to http and this error was emitted
Nothing to worry about!