From 568a735eec14f978ed5d37e325cd8c0f0217d7f9 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Tue, 8 May 2018 07:35:07 +0800 Subject: [PATCH] add forum --- deploy/nginx/locations.conf | 9 +++++++++ deploy/nginx/nginx.conf | 5 +++++ deploy/supervisord.conf | 12 ++++++++++++ 3 files changed, 26 insertions(+) diff --git a/deploy/nginx/locations.conf b/deploy/nginx/locations.conf index a096ffa6..d5d3ffef 100644 --- a/deploy/nginx/locations.conf +++ b/deploy/nginx/locations.conf @@ -20,6 +20,15 @@ location /.well-known { alias /data/ssl/.well-known; } +location /forum { + proxy_pass http://forum; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $http_host; + client_max_body_size 200M; + proxy_http_version 1.1; + proxy_set_header Connection ''; +} + location / { root /app/dist; try_files $uri $uri/ /index.html =404; diff --git a/deploy/nginx/nginx.conf b/deploy/nginx/nginx.conf index cdf8fe12..f2aa09ac 100644 --- a/deploy/nginx/nginx.conf +++ b/deploy/nginx/nginx.conf @@ -32,6 +32,11 @@ http { keepalive 32; } + upstream forum { + server 127.0.0.1:8081; + keepalive 32; + } + server { listen 8000 default_server; server_name _; diff --git a/deploy/supervisord.conf b/deploy/supervisord.conf index 6b231665..9134e071 100644 --- a/deploy/supervisord.conf +++ b/deploy/supervisord.conf @@ -39,6 +39,18 @@ startsecs=5 stopwaitsecs = 5 killasgroup=true +[program:forum] +command=sh -c "python3 manage.py runserver 8081" +directory=/app/forum/ +user=nobody +stdout_logfile=/data/log/forum.log +stderr_logfile=/data/log/forum.log +autostart=true +autorestart=true +startsecs=5 +stopwaitsecs = 5 +killasgroup=true + [program:celery] command=celery -A oj worker -l warning directory=/app/