deploy: fix service example

This commit is contained in:
2026-01-02 13:13:40 +08:00
parent 49fdda6e77
commit 8a90db7c27
2 changed files with 9 additions and 4 deletions
+4 -2
View File
@@ -29,6 +29,8 @@ Wants=network-online.target
[Service] [Service]
Type=forking Type=forking
# CHANGE THIS: Replace with your actual username
User=username
# CHANGE THIS: Replace with your actual installation path # CHANGE THIS: Replace with your actual installation path
# Example: /home/username/CheckInApp # Example: /home/username/CheckInApp
@@ -44,8 +46,8 @@ ExecStart=/path/to/CheckInApp/manage.sh start backend
ExecStop=/path/to/CheckInApp/manage.sh stop backend ExecStop=/path/to/CheckInApp/manage.sh stop backend
# Restart policy # Restart policy
Restart=always Restart=on-failure
RestartSec=10 RestartSec=10s
# Kill settings # Kill settings
KillSignal=SIGTERM KillSignal=SIGTERM
+5 -2
View File
@@ -41,19 +41,22 @@ server {
# ========================================== # ==========================================
location /api/ { location /api/ {
# Proxy to backend FastAPI server # Proxy to backend FastAPI server
proxy_pass http://127.0.0.1:8000; proxy_pass http://localhost:8000/api/;
# Proxy headers # Proxy headers
proxy_set_header Host $host; proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host:$server_port;
# HTTP version and buffering # HTTP version and buffering
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_buffering off; proxy_buffering off;
proxy_request_buffering off; proxy_request_buffering off;
proxy_redirect off;
# Timeouts # Timeouts
proxy_connect_timeout 60s; proxy_connect_timeout 60s;
proxy_send_timeout 60s; proxy_send_timeout 60s;