瀏覽代碼

Add gunicorn, supervisor and nginx configs

pull/2/head
Noah Petherbridge 4 年之前
父節點
當前提交
0b85aaf091
共有 3 個文件被更改,包括 33 次插入0 次删除
  1. 21
    0
      etc/nginx.conf
  2. 6
    0
      etc/rophako.conf
  3. 6
    0
      wsgi_gunicorn.py

+ 21
- 0
etc/nginx.conf 查看文件

@@ -0,0 +1,21 @@
# Example config for a site on nginx using supervisor/gunicorn
server {
server_name www.example.com example.com;
listen 80;

root /home/www-data/git/rophako;

location /static {
alias /home/www-data/www/static;
}
location /favicon.ico {
alias /home/www-data/www/favicon.ico;
}

location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://127.0.0.1:9000;
}
}

+ 6
- 0
etc/rophako.conf 查看文件

@@ -0,0 +1,6 @@
# Example conf for supervisor
[program:rophako]
command = /home/www-data/.virtualenv/rophako/bin/gunicorn -b 127.0.0.1:9000 wsgi_gunicorn:app
environment = ROPHAKO_SETTINGS="/home/www-data/site/settings.ini"
directory = /home/www-data/git/rophako
user = www-data

+ 6
- 0
wsgi_gunicorn.py 查看文件

@@ -0,0 +1,6 @@
#!/usr/bin/env python

from rophako.app import app

if __name__ == "__main__":
app.run(host='127.0.0.1')

Loading…
取消
儲存