tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
3.05k stars 255 forks source link

Keyoard doesn't work with custom domain #658

Closed lamarios closed 3 years ago

lamarios commented 3 years ago

Description

When using a custom domain https://kvm.mydomain.com the keyboard connection doesn't work anymore, the rest of the UI / ustreamer window works fine. It used to work.

What's the behavior that you expect?

Keyboard input to be working

What's happening instead?

Browser error:

 POST https://kvm.mydomain.com/socket.io/?EIO=4&transport=polling&t=NZizefx&sid=y6UV9qZRc9RF-
WebSocket connection to 'wss://kvm.mydomain.com/socket.io/?EIO=4&transport=websocket&sid=y6UV9qZRc9RF-6sfAAAn' failed: 

What are the steps to reproduce this behavior?

  1. Set a custom domain for tinypilot (https://kvm.mydomain.com)
  2. Set up a reverse proxy to redirect domain to tinypilot. (HAProxy in my case)
  3. Open tinypilot with this domain
  4. Keyboard not working
mtlynch commented 3 years ago

Thanks for reporting! Can you share your logs and HAProxy config?

lamarios commented 3 years ago

Forgot to mention but if i use the ip of the machine running tinypilot it works as expected and it is installed on an ubuntu machine with the install script.

Logs:

TinyPilot log dump
https://tinypilotkvm.com
Timestamp: 2021-04-21T11:35:42+08:00

Software versions
TinyPilot version: 1.4.1-23-g3322c22 3322c22
uStreamer version: v3.23 74bf710
OS version: Linux up 5.8.0-49-generic #55~20.04.1-Ubuntu SMP Fri Mar 26 01:01:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

voltage logs

TinyPilot configuration
[Unit]
Description=TinyPilot - RPi-based virtual KVM
After=syslog.target network.target
StartLimitIntervalSec=0

[Service]
Type=simple
User=tinypilot
WorkingDirectory=/opt/tinypilot
ExecStart=/opt/tinypilot/venv/bin/python app/main.py
Environment=HOST=127.0.0.1
Environment=PORT=8000
Environment=KEYBOARD_PATH=/dev/hidg0
Environment=MOUSE_PATH=/dev/hidg1
Restart=always

[Install]
WantedBy=multi-user.target

TinyPilot logs
Mar 15 17:41:23 up python[860]: [2021-03-15 17:41:23,887] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:42:53 up python[860]: [2021-03-15 17:42:53,962] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:43:23 up python[860]: [2021-03-15 17:43:23,722] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:43:57 up python[860]: [2021-03-15 17:43:57,730] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:45:25 up python[860]: [2021-03-15 17:45:25,838] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:47:27 up python[860]: [2021-03-15 17:47:27,254] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:47:36 up python[860]: [2021-03-15 17:47:36,515] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:47:39 up python[860]: [2021-03-15 17:47:39,717] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:47:43 up python[860]: [2021-03-15 17:47:43,052] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:47:43 up python[860]: [2021-03-15 17:47:43,646] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:48:49 up python[860]: [2021-03-15 17:48:49,575] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:48:50 up python[860]: [2021-03-15 17:48:50,396] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:48:51 up python[860]: [2021-03-15 17:48:51,236] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:48:56 up python[860]: [2021-03-15 17:48:56,715] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:48:57 up python[860]: [2021-03-15 17:48:57,237] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:48:57 up python[860]: [2021-03-15 17:48:57,749] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:49:00 up python[860]: [2021-03-15 17:49:00,595] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:50:31 up python[860]: [2021-03-15 17:50:31,408] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:51:37 up python[860]: [2021-03-15 17:51:37,202] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:51:38 up python[860]: [2021-03-15 17:51:38,353] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:54:05 up python[860]: [2021-03-15 17:54:05,895] INFO in socket_api: Client disconnected
Mar 15 17:54:06 up python[860]: [2021-03-15 17:54:06,062] INFO in socket_api: Client connected
Mar 15 17:54:07 up python[860]: [2021-03-15 17:54:07,073] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:54:07 up python[860]: [2021-03-15 17:54:07,587] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:54:08 up python[860]: [2021-03-15 17:54:08,112] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 17:54:11 up python[860]: [2021-03-15 17:54:11,748] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 15 18:22:43 up python[860]: [2021-03-15 18:22:43,010] INFO in socket_api: Client disconnected
Mar 16 16:47:25 up python[860]: [2021-03-16 16:47:25,045] INFO in socket_api: Client connected
Mar 16 16:47:27 up python[860]: [2021-03-16 16:47:27,812] INFO in socket_api: Client disconnected
Mar 16 16:49:09 up python[860]: [2021-03-16 16:49:09,608] INFO in socket_api: Client connected
Mar 16 16:49:57 up python[860]: [2021-03-16 16:49:57,038] INFO in socket_api: Client disconnected
Mar 17 20:22:49 up python[860]: [2021-03-17 20:22:49,645] INFO in socket_api: Client connected
Mar 17 20:23:19 up python[860]: [2021-03-17 20:23:19,796] INFO in socket_api: Client disconnected
Mar 17 21:39:31 up python[860]: [2021-03-17 21:39:31,116] INFO in socket_api: Client connected
Mar 17 21:41:51 up python[860]: [2021-03-17 21:41:51,540] INFO in socket_api: Client disconnected
Mar 18 11:45:24 up python[860]: [2021-03-18 11:45:24,027] INFO in socket_api: Client connected
Mar 18 11:45:24 up python[860]: [2021-03-18 11:45:24,640] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 18 11:45:25 up python[860]: [2021-03-18 11:45:25,156] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 18 11:45:31 up python[860]: [2021-03-18 11:45:31,660] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 18 11:45:33 up python[860]: [2021-03-18 11:45:33,550] INFO in socket_api: Client disconnected
Mar 22 22:00:45 up python[860]: [2021-03-22 22:00:45,978] INFO in socket_api: Client connected
Mar 22 22:02:31 up python[860]: [2021-03-22 22:02:31,091] INFO in socket_api: Client disconnected
Mar 22 22:21:30 up python[860]: [2021-03-22 22:21:30,533] INFO in socket_api: Client connected
Mar 22 22:21:39 up python[860]: [2021-03-22 22:21:39,298] INFO in socket_api: Client disconnected
Mar 24 20:26:03 up python[860]: [2021-03-24 20:26:03,329] INFO in socket_api: Client connected
Mar 24 20:26:04 up python[860]: [2021-03-24 20:26:04,789] INFO in socket_api: Client disconnected
Mar 26 17:34:21 up python[860]: [2021-03-26 17:34:21,643] INFO in socket_api: Client connected
Mar 26 17:34:27 up python[860]: [2021-03-26 17:34:27,381] INFO in socket_api: Client disconnected
Mar 29 10:41:22 up python[860]: [2021-03-29 10:41:22,133] INFO in socket_api: Client connected
Mar 29 10:41:23 up python[860]: [2021-03-29 10:41:23,253] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 29 10:41:24 up python[860]: [2021-03-29 10:41:24,101] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 29 10:43:08 up python[860]: [2021-03-29 10:43:08,720] INFO in socket_api: Client disconnected
Mar 29 11:28:55 up systemd[1]: Stopping TinyPilot - RPi-based virtual KVM...
Mar 29 11:28:57 up systemd[1]: tinypilot.service: Succeeded.
Mar 29 11:28:57 up systemd[1]: Stopped TinyPilot - RPi-based virtual KVM.
-- Reboot --
Mar 29 11:30:31 up systemd[1]: Started TinyPilot - RPi-based virtual KVM.
Mar 29 11:30:34 up python[656]: [2021-03-29 11:30:34,742] INFO in main: Starting app
Mar 29 11:30:34 up python[656]: [2021-03-29 11:30:34,878] INFO in _internal:  * Restarting with stat
Mar 29 11:30:36 up python[760]: [2021-03-29 11:30:36,112] INFO in main: Starting app
Mar 29 16:28:19 up python[760]: [2021-03-29 16:28:19,685] INFO in socket_api: Client connected
Mar 29 16:28:20 up python[760]: [2021-03-29 16:28:20,943] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 29 16:28:21 up python[760]: [2021-03-29 16:28:21,513] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 29 16:28:22 up python[760]: [2021-03-29 16:28:22,025] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 29 16:28:24 up python[760]: [2021-03-29 16:28:24,897] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Mar 29 16:28:30 up python[760]: [2021-03-29 16:28:30,756] INFO in socket_api: Client disconnected
Apr 02 16:43:25 up python[760]: [2021-04-02 16:43:25,649] INFO in socket_api: Client connected
Apr 02 16:43:26 up python[760]: [2021-04-02 16:43:26,808] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:27 up python[760]: [2021-04-02 16:43:27,423] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:27 up python[760]: [2021-04-02 16:43:27,944] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:28 up python[760]: [2021-04-02 16:43:28,455] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:28 up python[760]: [2021-04-02 16:43:28,976] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:29 up python[760]: [2021-04-02 16:43:29,488] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:30 up python[760]: [2021-04-02 16:43:30,010] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:30 up python[760]: [2021-04-02 16:43:30,522] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:31 up python[760]: [2021-04-02 16:43:31,086] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:31 up python[760]: [2021-04-02 16:43:31,600] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:32 up python[760]: [2021-04-02 16:43:32,121] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:32 up python[760]: [2021-04-02 16:43:32,634] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:33 up python[760]: [2021-04-02 16:43:33,259] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:33 up python[760]: [2021-04-02 16:43:33,771] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:38 up python[760]: [2021-04-02 16:43:38,898] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:40 up python[760]: [2021-04-02 16:43:40,986] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:53 up python[760]: [2021-04-02 16:43:53,444] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:43:56 up python[760]: [2021-04-02 16:43:56,630] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 16:45:33 up systemd[1]: Stopping TinyPilot - RPi-based virtual KVM...
Apr 02 16:45:34 up systemd[1]: tinypilot.service: Succeeded.
Apr 02 16:45:34 up systemd[1]: Stopped TinyPilot - RPi-based virtual KVM.
-- Reboot --
Apr 02 16:46:27 up systemd[1]: Started TinyPilot - RPi-based virtual KVM.
Apr 02 16:46:28 up python[787]: [2021-04-02 16:46:28,810] INFO in main: Starting app
Apr 02 16:46:28 up python[787]: [2021-04-02 16:46:28,857] INFO in _internal:  * Restarting with stat
Apr 02 16:46:29 up python[847]: [2021-04-02 16:46:29,701] INFO in main: Starting app
Apr 02 16:46:45 up python[847]: [2021-04-02 16:46:45,731] INFO in socket_api: Client connected
Apr 02 17:01:12 up python[847]: [2021-04-02 17:01:12,029] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:01:13 up python[847]: [2021-04-02 17:01:13,030] INFO in socket_api: Client disconnected
Apr 02 17:10:37 up systemd[1]: Stopping TinyPilot - RPi-based virtual KVM...
Apr 02 17:10:38 up systemd[1]: tinypilot.service: Succeeded.
Apr 02 17:10:38 up systemd[1]: Stopped TinyPilot - RPi-based virtual KVM.
-- Reboot --
Apr 02 17:11:30 up systemd[1]: Started TinyPilot - RPi-based virtual KVM.
Apr 02 17:11:32 up python[774]: [2021-04-02 17:11:32,799] INFO in main: Starting app
Apr 02 17:11:32 up python[774]: [2021-04-02 17:11:32,844] INFO in _internal:  * Restarting with stat
Apr 02 17:11:33 up python[848]: [2021-04-02 17:11:33,809] INFO in main: Starting app
Apr 02 17:17:26 up python[848]: [2021-04-02 17:17:26,410] INFO in socket_api: Client connected
Apr 02 17:17:33 up python[848]: [2021-04-02 17:17:33,023] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:34 up python[848]: [2021-04-02 17:17:34,717] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:35 up python[848]: [2021-04-02 17:17:35,225] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:35 up python[848]: [2021-04-02 17:17:35,784] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:36 up python[848]: [2021-04-02 17:17:36,296] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:36 up python[848]: [2021-04-02 17:17:36,822] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:37 up python[848]: [2021-04-02 17:17:37,333] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:37 up python[848]: [2021-04-02 17:17:37,854] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:38 up python[848]: [2021-04-02 17:17:38,367] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:40 up python[848]: [2021-04-02 17:17:40,933] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:41 up python[848]: [2021-04-02 17:17:41,452] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:41 up python[848]: [2021-04-02 17:17:41,962] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:42 up python[848]: [2021-04-02 17:17:42,488] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:42 up python[848]: [2021-04-02 17:17:42,998] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:43 up python[848]: [2021-04-02 17:17:43,520] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:44 up python[848]: [2021-04-02 17:17:44,030] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:44 up python[848]: [2021-04-02 17:17:44,555] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 02 17:17:44 up python[848]: [2021-04-02 17:17:44,561] INFO in socket_api: Client disconnected
Apr 02 17:24:37 up systemd[1]: Stopping TinyPilot - RPi-based virtual KVM...
Apr 02 17:24:39 up systemd[1]: tinypilot.service: Succeeded.
Apr 02 17:24:39 up systemd[1]: Stopped TinyPilot - RPi-based virtual KVM.
-- Reboot --
Apr 02 17:25:30 up systemd[1]: Started TinyPilot - RPi-based virtual KVM.
Apr 02 17:25:33 up python[803]: [2021-04-02 17:25:33,358] INFO in main: Starting app
Apr 02 17:25:33 up python[803]: [2021-04-02 17:25:33,410] INFO in _internal:  * Restarting with stat
Apr 02 17:25:34 up python[912]: [2021-04-02 17:25:34,530] INFO in main: Starting app
Apr 08 14:46:08 up python[912]: [2021-04-08 14:46:08,775] INFO in socket_api: Client connected
Apr 08 14:46:10 up python[912]: [2021-04-08 14:46:10,150] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 08 14:54:00 up python[912]: [2021-04-08 14:54:00,614] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 08 14:54:01 up python[912]: [2021-04-08 14:54:01,806] INFO in socket_api: Client disconnected
Apr 08 14:56:50 up python[912]: [2021-04-08 14:56:50,844] INFO in socket_api: Client connected
Apr 08 14:56:51 up python[912]: [2021-04-08 14:56:51,461] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 08 14:56:51 up python[912]: [2021-04-08 14:56:51,978] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 08 14:59:26 up python[912]: [2021-04-08 14:59:26,839] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 08 14:59:29 up python[912]: [2021-04-08 14:59:29,025] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 08 14:59:42 up python[912]: [2021-04-08 14:59:42,120] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 08 14:59:43 up python[912]: [2021-04-08 14:59:43,122] INFO in socket_api: Client disconnected
Apr 13 10:53:46 up python[912]: [2021-04-13 10:53:46,896] INFO in socket_api: Client connected
Apr 13 10:53:48 up python[912]: [2021-04-13 10:53:48,263] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 10:53:51 up python[912]: [2021-04-13 10:53:51,710] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 10:53:52 up python[912]: [2021-04-13 10:53:52,233] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 10:53:52 up python[912]: [2021-04-13 10:53:52,676] INFO in socket_api: Client disconnected
Apr 13 12:27:39 up python[912]: [2021-04-13 12:27:39,823] INFO in _internal:  * Detected change in '/opt/tinypilot/app/main.py', reloading
Apr 13 12:27:40 up python[803]: [2021-04-13 12:27:40,226] INFO in _internal:  * Restarting with stat
Apr 13 12:27:41 up python[847639]: [2021-04-13 12:27:41,164] INFO in main: Starting app
Apr 13 12:27:59 up systemd[1]: Stopping TinyPilot - RPi-based virtual KVM...
Apr 13 12:28:00 up systemd[1]: tinypilot.service: Succeeded.
Apr 13 12:28:00 up systemd[1]: Stopped TinyPilot - RPi-based virtual KVM.
Apr 13 12:28:00 up systemd[1]: Started TinyPilot - RPi-based virtual KVM.
Apr 13 12:28:01 up python[847840]: [2021-04-13 12:28:01,776] INFO in main: Starting app
Apr 13 14:19:34 up systemd[1]: Stopping TinyPilot - RPi-based virtual KVM...
Apr 13 14:19:34 up systemd[1]: tinypilot.service: Succeeded.
Apr 13 14:19:34 up systemd[1]: Stopped TinyPilot - RPi-based virtual KVM.
-- Reboot --
Apr 13 14:20:27 up systemd[1]: Started TinyPilot - RPi-based virtual KVM.
Apr 13 14:20:30 up python[807]: [2021-04-13 14:20:30,976] INFO in main: Starting app
Apr 13 14:25:09 up python[807]: [2021-04-13 14:25:09,535] INFO in socket_api: Client connected
Apr 13 14:25:10 up python[807]: [2021-04-13 14:25:10,409] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:25:10 up python[807]: [2021-04-13 14:25:10,995] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:25:11 up python[807]: [2021-04-13 14:25:11,507] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:25:53 up python[807]: [2021-04-13 14:25:53,610] INFO in socket_api: Client disconnected
Apr 13 14:28:43 up python[807]: https://kvm.mydomain.com is not an accepted origin. (further occurrences of this error will be logged with level INFO)
Apr 13 14:28:43 up python[807]: [2021-04-13 14:28:43,604] ERROR in server: https://kvm.mydomain.com is not an accepted origin. (further occurrences of this error will be logged with level INFO)
Apr 13 14:30:01 up python[807]: [2021-04-13 14:30:01,118] INFO in socket_api: Client connected
Apr 13 14:30:01 up python[807]: [2021-04-13 14:30:01,985] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:02 up python[807]: [2021-04-13 14:30:02,507] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:03 up python[807]: [2021-04-13 14:30:03,019] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:05 up python[807]: [2021-04-13 14:30:05,768] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:08 up python[807]: [2021-04-13 14:30:08,488] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:14 up python[807]: [2021-04-13 14:30:14,511] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:20 up python[807]: [2021-04-13 14:30:20,673] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:21 up python[807]: [2021-04-13 14:30:21,989] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:22 up python[807]: [2021-04-13 14:30:22,510] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:23 up python[807]: [2021-04-13 14:30:23,022] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:23 up python[807]: [2021-04-13 14:30:23,543] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:24 up python[807]: [2021-04-13 14:30:24,056] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:27 up python[807]: [2021-04-13 14:30:27,808] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:28 up python[807]: [2021-04-13 14:30:28,321] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:28 up python[807]: [2021-04-13 14:30:28,842] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 13 14:30:28 up python[807]: [2021-04-13 14:30:28,847] INFO in socket_api: Client disconnected
Apr 19 17:34:46 up python[807]: [2021-04-19 17:34:46,915] INFO in socket_api: Client connected
Apr 19 17:34:47 up python[807]: [2021-04-19 17:34:47,981] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 19 17:34:49 up python[807]: [2021-04-19 17:34:49,481] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 19 17:34:50 up python[807]: [2021-04-19 17:34:50,002] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 19 17:34:50 up python[807]: [2021-04-19 17:34:50,515] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 19 17:34:51 up python[807]: [2021-04-19 17:34:51,480] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 19 17:38:44 up python[807]: [2021-04-19 17:38:44,781] ERROR in socket_api: Failed to forward mouse event: Failed to write to HID interface: /dev/hidg1. Is USB cable connected?
Apr 19 17:38:46 up python[807]: [2021-04-19 17:38:46,511] INFO in socket_api: Client disconnected
Apr 21 11:35:42 up sudo[621113]: tinypilot : TTY=unknown ; PWD=/opt/tinypilot ; USER=root ; COMMAND=/opt/tinypilot-privileged/collect-debug-logs -q
Apr 21 11:35:42 up sudo[621113]: pam_unix(sudo:session): session opened for user root by (uid=0)
Apr 21 11:35:42 up sudo[621122]:     root : TTY=unknown ; PWD=/opt/ustreamer ; USER=root ; COMMAND=/usr/bin/journalctl -xe
Apr 21 11:35:42 up sudo[621122]: pam_unix(sudo:session): session opened for user root by (uid=0)
Apr 21 11:35:43 up sudo[621122]: pam_unix(sudo:session): session closed for user root
Apr 21 11:35:43 up sudo[621126]:     root : TTY=unknown ; PWD=/opt/ustreamer ; USER=root ; COMMAND=/usr/bin/journalctl -u tinypilot
Apr 21 11:35:43 up sudo[621126]: pam_unix(sudo:session): session opened for user root by (uid=0)

TinyPilot update logs

uStreamer configuration
[Unit]
Description=uStreamer - Lightweight, optimized video encoder
After=syslog.target network.target

[Service]
Type=simple
User=ustreamer
WorkingDirectory=/opt/ustreamer
ExecStart=/opt/ustreamer/ustreamer \
  --host 127.0.0.1 \
  --port 8001 \
  --encoder hw \
  --format jpeg \
  --desired-fps 30 \
  --resolution 1920x1080 \
  --persistent \

Restart=always

[Install]
WantedBy=multi-user.target

uStreamer logs
Apr 13 12:28:01 up ustreamer[805]: -- INFO  [932617.155      main] -- ===== Stopping by SIGTERM =====
Apr 13 12:28:01 up ustreamer[805]: -- INFO  [932617.156      http] -- HTTP eventloop stopped
Apr 13 12:28:01 up ustreamer[805]: -- INFO  [932617.158    stream] -- Destroying workers pool ...
Apr 13 12:28:01 up ustreamer[805]: -- INFO  [932617.160    stream] -- Capturing stopped
Apr 13 12:28:01 up ustreamer[805]: -- INFO  [932617.162    stream] -- Device fd=8 closed
Apr 13 12:28:01 up ustreamer[805]: -- INFO  [932617.162      main] -- Bye-bye
Apr 13 12:28:01 up systemd[1]: ustreamer.service: Succeeded.
Apr 13 12:28:01 up systemd[1]: Stopped uStreamer - Lightweight, optimized video encoder.
Apr 13 12:28:01 up systemd[1]: Started uStreamer - Lightweight, optimized video encoder.
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.193      main] -- Using internal blank placeholder
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.193      main] -- Listening HTTP on [127.0.0.1]:8001
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.193    stream] -- Using V4L2 device: /dev/video0
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.193    stream] -- Using desired FPS: 30
Apr 13 12:28:01 up ustreamer[847870]: ================================================================================
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.194    stream] -- Device fd=8 opened
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.194    stream] -- Using input channel: 0
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.194      http] -- Starting HTTP eventloop ...
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.201    stream] -- Using resolution: 1920x1080
Apr 13 12:28:01 up ustreamer[847870]: -- ERROR [932617.201    stream] -- Could not obtain the requested pixelformat=JPEG; driver gave us MJPEG
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.201    stream] -- Falling back to pixelformat=MJPEG
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.201    stream] -- Using pixelformat: MJPEG
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.204    stream] -- Using HW FPS: 30
Apr 13 12:28:01 up ustreamer[847870]: -- ERROR [932617.204    stream] -- Device does not support setting of HW encoding quality parameters
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.204    stream] -- Using IO method: MMAP
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.214    stream] -- Requested 3 device buffers, got 3
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.220    stream] -- Capturing started
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.221    stream] -- Using JPEG quality: encoder default
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.221    stream] -- Creating pool JPEG with 1 workers ...
Apr 13 12:28:01 up ustreamer[847870]: -- INFO  [932617.222    stream] -- Capturing ...
Apr 13 14:19:34 up ustreamer[847870]: -- INFO  [939310.499      main] -- ===== Stopping by SIGTERM =====
Apr 13 14:19:34 up ustreamer[847870]: -- INFO  [939310.499      http] -- HTTP eventloop stopped
Apr 13 14:19:34 up ustreamer[847870]: -- INFO  [939310.512    stream] -- Destroying workers pool JPEG ...
Apr 13 14:19:34 up ustreamer[847870]: -- INFO  [939310.514    stream] -- Capturing stopped
Apr 13 14:19:34 up ustreamer[847870]: -- INFO  [939310.515    stream] -- Device fd=8 closed
Apr 13 14:19:34 up ustreamer[847870]: -- INFO  [939310.520      main] -- Bye-bye
Apr 13 14:19:34 up systemd[1]: Stopping uStreamer - Lightweight, optimized video encoder...
Apr 13 14:19:34 up systemd[1]: ustreamer.service: Succeeded.
Apr 13 14:19:34 up systemd[1]: Stopped uStreamer - Lightweight, optimized video encoder.
-- Reboot --
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.276      main] -- Using internal blank placeholder
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.276      main] -- Listening HTTP on [127.0.0.1]:8001
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.277    stream] -- Using V4L2 device: /dev/video0
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.277    stream] -- Using desired FPS: 30
Apr 13 14:20:28 up ustreamer[810]: ================================================================================
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.277      http] -- Starting HTTP eventloop ...
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.392    stream] -- Device fd=8 opened
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.393    stream] -- Using input channel: 0
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.393    stream] -- Using resolution: 1920x1080
Apr 13 14:20:28 up ustreamer[810]: -- ERROR [16.393    stream] -- Could not obtain the requested pixelformat=JPEG; driver gave us MJPEG
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.394    stream] -- Falling back to pixelformat=MJPEG
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.394    stream] -- Using pixelformat: MJPEG
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.394    stream] -- Using HW FPS: 30
Apr 13 14:20:28 up ustreamer[810]: -- ERROR [16.394    stream] -- Device does not support setting of HW encoding quality parameters
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.394    stream] -- Using IO method: MMAP
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.399    stream] -- Requested 3 device buffers, got 3
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.401    stream] -- Capturing started
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.401    stream] -- Using JPEG quality: encoder default
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.401    stream] -- Creating pool JPEG with 1 workers ...
Apr 13 14:20:28 up ustreamer[810]: -- INFO  [16.405    stream] -- Capturing ...
Apr 13 14:20:27 up systemd[1]: Started uStreamer - Lightweight, optimized video encoder.
Apr 13 14:25:09 up ustreamer[810]: -- INFO  [297.911      http] -- HTTP: Registered client: [192.168.7.234]:48996, id=da6e9445b426c499; clients now: 1
Apr 13 14:25:53 up ustreamer[810]: -- INFO  [342.207      http] -- HTTP: Disconnected client: [192.168.7.234]:48996, id=da6e9445b426c499, Connection reset by peer (reading,error); clients now: 0
Apr 13 14:28:43 up ustreamer[810]: -- INFO  [511.984      http] -- HTTP: Registered client: [192.168.7.1]:49138, id=b394b0aa154e3c57; clients now: 1
Apr 13 14:29:33 up ustreamer[810]: -- INFO  [562.816      http] -- HTTP: Registered client: [192.168.7.1]:49336, id=b49da20060449aae; clients now: 2
Apr 13 14:30:00 up ustreamer[810]: -- INFO  [589.849      http] -- HTTP: Registered client: [192.168.7.234]:49450, id=b3e917e335c1bb0e; clients now: 3
Apr 13 14:30:03 up ustreamer[810]: -- INFO  [592.835      http] -- HTTP: Disconnected client: [192.168.7.1]:49138, id=b394b0aa154e3c57, Resource temporarily unavailable (reading,eof); clients now: 2
Apr 13 14:30:28 up ustreamer[810]: -- INFO  [617.504      http] -- HTTP: Disconnected client: [192.168.7.234]:49450, id=b3e917e335c1bb0e, Transport endpoint is not connected (reading,eof); clients now: 1
Apr 13 14:30:30 up ustreamer[810]: -- INFO  [619.843      http] -- HTTP: Disconnected client: [192.168.7.1]:49336, id=b49da20060449aae, Transport endpoint is not connected (reading,eof); clients now: 0
Apr 19 17:34:35 up ustreamer[810]: -- INFO  [530092.626      http] -- HTTP: Registered client: [192.168.7.1]:53206, id=f09f45022914eefa; clients now: 1
Apr 19 17:34:46 up ustreamer[810]: -- INFO  [530103.496      http] -- HTTP: Registered client: [192.168.7.153]:53284, id=4d973cee84c046f1; clients now: 2
Apr 19 17:35:16 up ustreamer[810]: -- INFO  [530133.636      http] -- HTTP: Disconnected client: [192.168.7.1]:53206, id=f09f45022914eefa, Resource temporarily unavailable (reading,eof); clients now: 1
Apr 19 17:38:46 up ustreamer[810]: -- INFO  [530343.995      http] -- HTTP: Disconnected client: [192.168.7.153]:53284, id=4d973cee84c046f1, Transport endpoint is not connected (reading,eof); clients now: 0
Apr 20 09:43:23 up ustreamer[810]: -- INFO  [588223.491      http] -- HTTP: Registered client: [192.168.7.1]:54946, id=e25d52992b9ee178; clients now: 1
Apr 20 09:44:10 up ustreamer[810]: -- INFO  [588271.111      http] -- HTTP: Registered client: [192.168.7.1]:55050, id=fef2cc198db5207f; clients now: 2
Apr 20 09:44:21 up ustreamer[810]: -- INFO  [588282.042      http] -- HTTP: Disconnected client: [192.168.7.1]:54946, id=e25d52992b9ee178, Broken pipe (writing,error); clients now: 1
Apr 20 09:44:56 up ustreamer[810]: -- INFO  [588317.373      http] -- HTTP: Disconnected client: [192.168.7.1]:55050, id=fef2cc198db5207f, Broken pipe (writing,error); clients now: 0
Apr 20 09:47:35 up ustreamer[810]: -- INFO  [588475.858      http] -- HTTP: Registered client: [192.168.7.1]:58542, id=aaeb0ecee2de669c; clients now: 1
Apr 20 09:56:31 up ustreamer[810]: -- INFO  [589012.317      http] -- HTTP: Disconnected client: [192.168.7.1]:58542, id=aaeb0ecee2de669c, Resource temporarily unavailable (reading,eof); clients now: 0
Apr 21 11:35:16 up ustreamer[810]: -- INFO  [681341.830      http] -- HTTP: Registered client: [192.168.7.1]:45588, id=75c5ef6d9f7063ed; clients now: 1
Apr 21 11:35:39 up ustreamer[810]: -- INFO  [681364.526      http] -- HTTP: Registered client: [192.168.7.1]:45642, id=bfe66b38102afcc1; clients now: 2

nginx logs
-- Logs begin at Sat 2021-03-06 11:23:59 +08, end at Wed 2021-04-21 11:35:43 +08. --
Mar 06 12:15:58 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 06 12:15:58 up systemd[1]: Started A high performance web server and a reverse proxy server.
Mar 06 12:17:09 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Mar 06 12:17:10 up systemd[1]: nginx.service: Succeeded.
Mar 06 12:17:10 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
Mar 06 12:17:10 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 06 12:17:10 up systemd[1]: Started A high performance web server and a reverse proxy server.
Mar 06 12:17:11 up systemd[1]: Reloading A high performance web server and a reverse proxy server.
Mar 06 12:17:11 up systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Mar 06 12:17:26 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Mar 06 12:17:26 up systemd[1]: nginx.service: Succeeded.
Mar 06 12:17:26 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Mar 06 12:18:15 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 06 12:18:15 up systemd[1]: Started A high performance web server and a reverse proxy server.
Mar 06 12:21:31 up systemd[1]: Reloading A high performance web server and a reverse proxy server.
Mar 06 12:21:31 up systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Mar 06 12:21:59 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Mar 06 12:22:04 up systemd[1]: nginx.service: Stopping timed out. Terminating.
Mar 06 12:22:04 up systemd[1]: nginx.service: Failed with result 'timeout'.
Mar 06 12:22:04 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
Mar 06 12:22:04 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 06 12:22:04 up nginx[2531]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Mar 06 12:22:04 up nginx[2531]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Mar 06 12:22:05 up nginx[2531]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Mar 06 12:22:05 up nginx[2531]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Mar 06 12:22:06 up nginx[2531]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Mar 06 12:22:06 up nginx[2531]: nginx: [emerg] still could not bind()
Mar 06 12:22:06 up systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Mar 06 12:22:06 up systemd[1]: nginx.service: Failed with result 'exit-code'.
Mar 06 12:22:06 up systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Mar 06 12:23:08 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 06 12:23:08 up nginx[2626]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Mar 06 12:23:08 up nginx[2626]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Mar 06 12:23:09 up nginx[2626]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Mar 06 12:23:09 up nginx[2626]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Mar 06 12:23:10 up nginx[2626]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Mar 06 12:23:10 up nginx[2626]: nginx: [emerg] still could not bind()
Mar 06 12:23:10 up systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Mar 06 12:23:10 up systemd[1]: nginx.service: Failed with result 'exit-code'.
Mar 06 12:23:10 up systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Mar 06 12:23:36 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 06 12:23:36 up systemd[1]: Started A high performance web server and a reverse proxy server.
Mar 06 12:31:52 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Mar 06 12:31:52 up systemd[1]: nginx.service: Succeeded.
Mar 06 12:31:52 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Mar 06 12:32:41 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 06 12:32:41 up systemd[1]: Started A high performance web server and a reverse proxy server.
Mar 06 12:52:57 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Mar 06 12:52:58 up systemd[1]: nginx.service: Succeeded.
Mar 06 12:52:58 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Mar 06 12:53:49 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 06 12:53:49 up systemd[1]: Started A high performance web server and a reverse proxy server.
Mar 06 14:15:09 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Mar 06 14:15:09 up systemd[1]: nginx.service: Succeeded.
Mar 06 14:15:09 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Mar 06 14:15:59 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 06 14:16:00 up systemd[1]: Started A high performance web server and a reverse proxy server.
Mar 06 14:23:57 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Mar 06 14:23:57 up systemd[1]: nginx.service: Succeeded.
Mar 06 14:23:57 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Mar 06 14:26:13 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 06 14:26:13 up systemd[1]: Started A high performance web server and a reverse proxy server.
Mar 29 11:28:55 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Mar 29 11:28:55 up systemd[1]: nginx.service: Succeeded.
Mar 29 11:28:55 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Mar 29 11:30:31 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 29 11:30:32 up systemd[1]: Started A high performance web server and a reverse proxy server.
Apr 02 16:45:33 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 02 16:45:33 up systemd[1]: nginx.service: Succeeded.
Apr 02 16:45:33 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Apr 02 16:46:27 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 02 16:46:27 up systemd[1]: Started A high performance web server and a reverse proxy server.
Apr 02 17:10:37 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 02 17:10:37 up systemd[1]: nginx.service: Succeeded.
Apr 02 17:10:37 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Apr 02 17:11:30 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 02 17:11:31 up systemd[1]: Started A high performance web server and a reverse proxy server.
Apr 02 17:24:37 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 02 17:24:38 up systemd[1]: nginx.service: Succeeded.
Apr 02 17:24:38 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Apr 02 17:25:30 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 02 17:25:30 up systemd[1]: Started A high performance web server and a reverse proxy server.
Apr 13 12:28:02 up systemd[1]: Reloading A high performance web server and a reverse proxy server.
Apr 13 12:28:02 up systemd[1]: Reloaded A high performance web server and a reverse proxy server.
Apr 13 14:19:34 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 13 14:19:35 up systemd[1]: nginx.service: Succeeded.
Apr 13 14:19:35 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Apr 13 14:20:27 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 13 14:20:27 up systemd[1]: Started A high performance web server and a reverse proxy server.
Apr 13 14:25:48 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 13 14:25:53 up systemd[1]: nginx.service: Stopping timed out. Terminating.
Apr 13 14:25:53 up systemd[1]: nginx.service: Failed with result 'timeout'.
Apr 13 14:25:53 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
Apr 13 14:25:53 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 13 14:25:53 up nginx[2019]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Apr 13 14:25:54 up nginx[2019]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Apr 13 14:25:54 up nginx[2019]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Apr 13 14:25:55 up nginx[2019]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Apr 13 14:25:55 up nginx[2019]: nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use)
Apr 13 14:25:56 up nginx[2019]: nginx: [emerg] still could not bind()
Apr 13 14:25:56 up systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Apr 13 14:25:56 up systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 13 14:25:56 up systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 13 14:27:47 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 13 14:27:47 up systemd[1]: Started A high performance web server and a reverse proxy server.
Apr 20 09:46:52 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 20 09:46:53 up systemd[1]: nginx.service: Succeeded.
Apr 20 09:46:53 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
Apr 20 09:46:53 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 20 09:46:53 up systemd[1]: Started A high performance web server and a reverse proxy server.
Apr 20 09:46:59 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 20 09:46:59 up systemd[1]: nginx.service: Succeeded.
Apr 20 09:46:59 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
Apr 20 09:46:59 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 20 09:46:59 up systemd[1]: Started A high performance web server and a reverse proxy server.
Apr 20 09:47:33 up systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 20 09:47:33 up systemd[1]: nginx.service: Succeeded.
Apr 20 09:47:33 up systemd[1]: Stopped A high performance web server and a reverse proxy server.
Apr 20 09:47:33 up systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 20 09:47:33 up systemd[1]: Started A high performance web server and a reverse proxy server.

2021/04/21 11:35:38 [warn] 540912#540912: *184108 upstream sent more data than specified in "Content-Length" header while reading upstream, client: 192.168.7.1, server: tinypilot, request: "GET /third-party/fonts/overpass-light.woff2 HTTP/1.1", upstream: "http://127.0.0.1:8000/third-party/fonts/overpass-light.woff2", host: "kvm.mydomain.com", referrer: "https://kvm.mydomain.com/third-party/fonts/fonts.css"
2021/04/21 11:35:39 [warn] 540912#540912: *184113 upstream sent more data than specified in "Content-Length" header while reading upstream, client: 192.168.7.1, server: tinypilot, request: "GET /third-party/fonts/overpass-mono-light.woff2 HTTP/1.1", upstream: "http://127.0.0.1:8000/third-party/fonts/overpass-mono-light.woff2", host: "kvm.mydomain.com", referrer: "https://kvm.mydomain.com/third-party/fonts/fonts.css"
2021/04/21 11:35:39 [warn] 540912#540912: *184112 upstream sent more data than specified in "Content-Length" header while reading upstream, client: 192.168.7.1, server: tinypilot, request: "GET /third-party/fonts/overpass-semibold.woff2 HTTP/1.1", upstream: "http://127.0.0.1:8000/third-party/fonts/overpass-semibold.woff2", host: "kvm.mydomain.com", referrer: "https://kvm.mydomain.com/third-party/fonts/fonts.css"
2021/04/21 11:35:42 [warn] 540913#540913: *184056 an upstream response is buffered to a temporary file /var/lib/nginx/proxy/2/00/0000000002 while reading upstream, client: 192.168.7.1, server: tinypilot, request: "GET /stream?advance_headers=1 HTTP/1.1", upstream: "http://127.0.0.1:8001/stream?advance_headers=1", host: "kvm.mydomain.com", referrer: "https://kvm.mydomain.com/"

192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /css/button.css HTTP/1.1" 200 963 "https://kvm.mydomain.com/css/style.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /css/cursors.css HTTP/1.1" 200 671 "https://kvm.mydomain.com/css/style.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /css/style.css HTTP/1.1" 200 1915 "https://kvm.mydomain.com/css/button.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /third-party/fonts/fonts.css HTTP/1.1" 200 1812 "https://kvm.mydomain.com/css/style.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /css/cursors.css HTTP/1.1" 200 671 "https://kvm.mydomain.com/css/style.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /css/cursors.css HTTP/1.1" 200 671 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /third-party/underscore.js/1.11.0/underscore-min.js HTTP/1.1" 200 18618 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /css/style.css HTTP/1.1" 200 1915 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /third-party/fonts/fonts.css HTTP/1.1" 200 1812 "https://kvm.mydomain.com/css/style.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /css/button.css HTTP/1.1" 200 963 "https://kvm.mydomain.com/css/style.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /css/cursors.css HTTP/1.1" 200 671 "https://kvm.mydomain.com/css/style.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /js/keycodes.js HTTP/1.1" 200 2930 "https://kvm.mydomain.com/js/app.js" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /js/keystrokes.js HTTP/1.1" 200 377 "https://kvm.mydomain.com/js/app.js" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /js/settings.js HTTP/1.1" 200 1196 "https://kvm.mydomain.com/js/app.js" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /js/overlays.js HTTP/1.1" 200 495 "https://kvm.mydomain.com/js/app.js" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /third-party/fonts/overpass-mono-light.woff2 HTTP/1.1" 304 5 "https://kvm.mydomain.com/third-party/fonts/fonts.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /third-party/fonts/overpass-semibold.woff2 HTTP/1.1" 304 5 "https://kvm.mydomain.com/third-party/fonts/fonts.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET /socket.io/?EIO=4&transport=polling&t=NZoVsV1 HTTP/1.1" 200 96 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "POST /socket.io/?EIO=4&transport=polling&t=NZoVsVX&sid=a3yBp9ZRixoY0l-5AACP HTTP/1.1" 400 50 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "POST /socket.io/?EIO=4&transport=polling&t=NZoVsVl&sid=a3yBp9ZRixoY0l-5AACP HTTP/1.1" 400 50 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:39 +0800] "GET / HTTP/1.0" 200 65233 "-" "-" "-"
192.168.7.1 - - [21/Apr/2021:11:35:40 +0800] "GET /socket.io/?EIO=4&transport=polling&t=NZoVsoE HTTP/1.1" 200 96 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:40 +0800] "POST /socket.io/?EIO=4&transport=polling&t=NZoVsoQ&sid=AQBejkv-XBvpshEcAACQ HTTP/1.1" 400 50 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:40 +0800] "GET /socket.io/?EIO=4&transport=websocket&sid=AQBejkv-XBvpshEcAACQ HTTP/1.1" 400 50 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:40 +0800] "POST /socket.io/?EIO=4&transport=polling&t=NZoVsob&sid=AQBejkv-XBvpshEcAACQ HTTP/1.1" 400 50 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:41 +0800] "GET / HTTP/1.0" 200 32465 "-" "-" "-"
192.168.7.1 - - [21/Apr/2021:11:35:41 +0800] "GET /socket.io/?EIO=4&transport=polling&t=NZoVtA1 HTTP/1.1" 200 96 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:41 +0800] "POST /socket.io/?EIO=4&transport=polling&t=NZoVtAK&sid=l9Nl4_pmGIA8oqzhAACR HTTP/1.1" 400 50 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:41 +0800] "GET /socket.io/?EIO=4&transport=websocket&sid=l9Nl4_pmGIA8oqzhAACR HTTP/1.1" 400 50 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"
192.168.7.1 - - [21/Apr/2021:11:35:42 +0800] "POST /socket.io/?EIO=4&transport=polling&t=NZoVtAc&sid=l9Nl4_pmGIA8oqzhAACR HTTP/1.1" 400 50 "https://kvm.mydomain.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" "-"

HAProxy config: I removed a lot of things from here. I kept what i think is relevant. It's auto generated by pfsense haproxy plugin.

# Automaticaly generated, dont edit manually.
# Generated on: 2021-04-19 18:03
global
    maxconn         1000
    stats socket /tmp/haproxy.socket level admin  expose-fd listeners
    uid         80
    gid         80
    nbproc          1
    nbthread            1
    hard-stop-after     15m
    chroot              /tmp/haproxy_chroot
    daemon
    tune.ssl.default-dh-param   2048
    server-state-file /tmp/haproxy_server_state

listen HAProxyLocalStats
    bind 127.0.0.1:444 name localstats
    mode http
    stats enable
    stats admin if TRUE
    stats show-legends
    stats uri /haproxy/haproxy_stats.php?haproxystats=1
    timeout client 5000
    timeout connect 5000
    timeout server 5000

frontend https
    bind            192.168.7.1:10443 name 192.168.7.1:10443   ssl crt-list /var/etc/haproxy/https.crt_list  
    mode            http
    log         global
    option          http-keep-alive
    timeout client      30000
    acl         lanOnly src 192.168.0.0/16
    acl         kvm var(txn.txnhost) -m reg -i (kvm)\.mydomain\.com
    http-request set-var(txn.txnhost) hdr(host)
    use_backend up-tinypilot_ipvANY  if  kvm lanOnly aclcrt_https

frontend http_to_https
    bind            192.168.7.1:10080 name 192.168.7.1:10080   
    mode            http
    log         global
    option          http-keep-alive
    timeout client      30000
    http-request redirect scheme https 

backend up-tinypilot_ipvANY
    mode            http
    id          110
    log         global
    timeout connect     30000
    timeout server      30000
    retries         3
    option          httpchk GET / 
    server          up 192.168.7.2:8888 id 101 check inter 1000  
mtlynch commented 3 years ago

It's hard to diagnose this since it seems like you've got a lot of custom configuration in your network setup.

I believe the root cause is that your HAProxy config isn't forwarding HTTP headers properly to the TinyPilot nginx instance, so the socket.io listener is rejecting the connection because it looks like a CSRF attack (where the Host header doesn't match the Origin header).

You'll need to watch the HTTP traffic between HAProxy and nginx to figure out what headers HAProxy is sending to nginx. You can do this with ncat. Here's an example command that creates a new ncat proxy on port 8080 and forwards the traffic directly to the TinyPilot instance at port 8000:

ncat -lkv localhost 8080 -c 'tee /dev/stderr | ncat -v localhost 8000 | tee /dev/stderr'

There's a bug in Flask-SocketIO that makes it a little trickier because Flask-SocketIO doesn't process all proxy forwarding headers correctly. The maintainer just fixed it, but it'll probably be a few weeks before the fix is in a published package.

If you don't want to debug the HTTP traffic, a hacky workaround is to change this line to this:

socketio = flask_socketio.SocketIO(cors_allowed_origins="*")

But you'll have to reapply the workaround after every update. It also exposes you to CSRF attacks, which you may or may not consider a credible risk.

lamarios commented 3 years ago

Thanks for the help, I went with the easy solution. instead of a reverse proxy i just set a redirect to my LAN IP as it is already set up to only allow requests coming from LAN.

mtlynch commented 3 years ago

Cool, glad to hear you got it working!