添加服务器配置文件
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
import os
|
||||||
|
import multiprocessing
|
||||||
|
|
||||||
|
bind = '0.0.0.0:8000'
|
||||||
|
backlog = 512
|
||||||
|
chdir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
timeout = 30
|
||||||
|
worker_class = 'sync'
|
||||||
|
|
||||||
|
workers = multiprocessing.cpu_count() * 2 + 1
|
||||||
|
threads = 2
|
||||||
|
loglevel = 'info'
|
||||||
|
access_log_format = '%(t)s %(p)s %(h)s "%(r)s" %(s)s %(L)s %(b)s %(f)s" "%(a)s"'
|
||||||
|
|
||||||
|
if not os.path.exists('logs'):
|
||||||
|
os.mkdir('logs')
|
||||||
|
|
||||||
|
accesslog = os.path.join(chdir, "logs/gunicorn_access.log")
|
||||||
|
errorlog = os.path.join(chdir, "logs/gunicorn_error.log")
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
access_log /var/log/nginx/access.log;
|
||||||
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:8000; # 转发的地址,即Gunicorn运行的地址
|
||||||
|
proxy_redirect off;
|
||||||
|
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
[program:pear]
|
||||||
|
command=bash /home/ubuntu/pear-admin-flask/start.sh
|
||||||
|
user=root
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
stopasgroup=true
|
||||||
|
killasgroup=true
|
||||||
Reference in New Issue
Block a user