From 8865ba2e89aafb249a3ef60c3089acf5eb7aa9ad Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Tue, 22 Dec 2020 21:51:39 +0300 Subject: [PATCH] Add conf files to tools --- tools/nginx.conf | 25 +++++++++++++++++++++++++ tools/supervisor.conf | 15 +++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 tools/nginx.conf create mode 100644 tools/supervisor.conf diff --git a/tools/nginx.conf b/tools/nginx.conf new file mode 100644 index 0000000..3761381 --- /dev/null +++ b/tools/nginx.conf @@ -0,0 +1,25 @@ +server { + listen 80; + #server_name taiko.example.com; + + location / { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $server_name; + proxy_pass http://127.0.0.1:34801; + } + + location ~ ^/(assets|songs|src)/ { + root /srv/taiko-web/public; + location ~ ^/songs/(\d+)/preview\.mp3$ { + try_files $uri /api/preview?id=$1; + } + } + + location /p2 { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass http://127.0.0.1:34802; + } +} diff --git a/tools/supervisor.conf b/tools/supervisor.conf new file mode 100644 index 0000000..f405b31 --- /dev/null +++ b/tools/supervisor.conf @@ -0,0 +1,15 @@ +[program:taiko_app] +directory=/srv/taiko-web +command=/srv/taiko-web/.venv/bin/gunicorn -b 127.0.0.1:34801 app:app +autostart=true +autorestart=true +stdout_logfile=/var/log/taiko-web/app.out.log +stderr_logfile=/var/log/taiko-web/app.err.log + +[program:taiko_server] +directory=/srv/taiko-web +command=/srv/taiko-web/.venv/bin/python server.py 34802 +autostart=true +autorestart=true +stdout_logfile=/var/log/taiko-web/server.out.log +stderr_logfile=/var/log/taiko-web/server.err.log