From 581329121e7fd3583f980fc34f58d533c888d9ed Mon Sep 17 00:00:00 2001 From: xingsu1021 Date: Mon, 23 May 2022 14:08:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Enginx=20unit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf.json | 1 + start.sh | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 conf.json diff --git a/conf.json b/conf.json new file mode 100644 index 0000000..3286d71 --- /dev/null +++ b/conf.json @@ -0,0 +1 @@ +{"settings":{"http":{"header_read_timeout":30,"body_read_timeout":30,"send_timeout":30,"idle_timeout":180,"max_body_size":10485760,"static":{"mime_types":{"text/plain":[".log","README","CHANGES"]}},"discard_unsafe_fields":false}},"listeners":{"*:80":{"pass":"routes"}},"routes":[{"match":{"uri":"/static/*"},"action":{"share":"/home/data/www$uri"}},{"action":{"pass":"applications/pthelper"}}],"applications":{"pthelper":{"type":"python 3","protocol":"wsgi","path":"/home/data/www/","processes":2,"module":"pthelper.wsgi","environment":{"DJANGO_SETTINGS_MODULE":"pthelper.settings"}}}} \ No newline at end of file diff --git a/start.sh b/start.sh index 526592d..a62530b 100644 --- a/start.sh +++ b/start.sh @@ -2,7 +2,6 @@ #初始化数据库 python3 manage.py migrate -python3 manage.py runserver 0.0.0.0:80 -#gunicorn pthelper.wsgi:application --bind 0.0.0.0:8000 -w 4 --threads 2 --daemon +#python3 manage.py runserver 0.0.0.0:80 -#nginx -g 'daemon off;' \ No newline at end of file +/usr/sbin/unitd --no-daemon --control 0.0.0.0:60081 --user root --group root \ No newline at end of file