This commit is contained in:
2025-10-07 17:03:14 +08:00
parent 8a4fec28cf
commit 22d4a9057b
13 changed files with 873 additions and 1 deletions

View File

@@ -2,6 +2,23 @@ location /public {
root /data;
}
# WebSocket 支持
location /ws/ {
proxy_pass http://websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP __IP_HEADER__;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket 超时设置
proxy_connect_timeout 7d;
proxy_send_timeout 7d;
proxy_read_timeout 7d;
}
location /api {
include api_proxy.conf;
}

View File

@@ -38,6 +38,11 @@ http {
keepalive 32;
}
upstream websocket {
server 127.0.0.1:8001;
keepalive 32;
}
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Frame-Options SAMEORIGIN always;
add_header X-Content-Type-Options nosniff always;
@@ -46,7 +51,7 @@ http {
listen 8000 default_server;
server_name _;
include http_locations.conf;
include locations.conf;
}
# server {

Binary file not shown.

View File

@@ -38,6 +38,18 @@ startsecs=5
stopwaitsecs = 5
killasgroup=true
[program:daphne]
command=daphne -b 127.0.0.1 -p 8001 --access-log /data/log/daphne_access.log oj.asgi:application
directory=/app/
user=server
stdout_logfile=/data/log/daphne.log
stderr_logfile=/data/log/daphne.log
autostart=true
autorestart=true
startsecs=5
stopwaitsecs = 5
killasgroup=true
[program:dramatiq]
command=python3 manage.py rundramatiq --processes %(ENV_MAX_WORKER_NUM)s --threads 4
directory=/app/