This commit is contained in:
Helva
2026-01-30 22:21:55 +01:00
commit 04c5db785a
8 changed files with 538 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
server {
listen 80;
server_name _;
root /opt/helva-robot/face/var/www/html;
index index.html;
location / {
try_files $uri $uri/ =404;
}
# API -> backend
location /api/ {
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# SSE stream -> backend
location /events {
proxy_pass http://127.0.0.1:8001/events;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_buffering off; # IMPORTANT for SSE
proxy_cache off;
proxy_read_timeout 1h;
proxy_send_timeout 1h;
add_header Cache-Control no-cache;
}
}
+17
View File
@@ -0,0 +1,17 @@
[Unit]
Description=Robot Face SSE Server
After=network.target
[Service]
WorkingDirectory=/opt/face
ExecStart=/opt/face/venv/bin/python -m uvicorn face_server:app --host 127.0.0.1 --port 8001 --app-dir /opt/face
Restart=always
RestartSec=1
# Tipp: eigener User ist sauber, aber www-data geht auch.
User=www-data
Group=www-data
[Install]
WantedBy=multi-user.target