Webserver stops working after a few hours

When I enable the webserver, it works for a while but then stops accepting requests. A simple cURL command will result in:

curl: (7) Failed to connect to IP port #: Connection refused.

If I uncheck the webserver option and re-enable it, it will work for a few hours and then stop working again. I'm on version 2.660 (968). It happens on two Mac (one is on 10.14 and another is on 10.13).

Same issue here on macOS 10.13.6. Webserver stops working after a while and is only enabled again with a restart or unchecking and rechecking the enable webserver option in advanced settings.