Browse Source

Add gunicorn, supervisor and nginx configs

pull/2/head
Noah Petherbridge 4 years ago
parent
commit
0b85aaf091
3 changed files with 33 additions and 0 deletions
  1. 21
    0
      etc/nginx.conf
  2. 6
    0
      etc/rophako.conf
  3. 6
    0
      wsgi_gunicorn.py

+ 21
- 0
etc/nginx.conf View File

@@ -0,0 +1,21 @@
1
+# Example config for a site on nginx using supervisor/gunicorn
2
+server {
3
+        server_name www.example.com example.com;
4
+        listen 80;
5
+
6
+        root /home/www-data/git/rophako;
7
+
8
+        location /static {
9
+                alias /home/www-data/www/static;
10
+        }
11
+        location /favicon.ico {
12
+                alias /home/www-data/www/favicon.ico;
13
+        }
14
+
15
+        location / {
16
+                proxy_set_header Host $host;
17
+                proxy_set_header X-Real-IP $remote_addr;
18
+                proxy_set_header X-Forwarded-For $remote_addr;
19
+                proxy_pass http://127.0.0.1:9000;
20
+        }
21
+}

+ 6
- 0
etc/rophako.conf View File

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

+ 6
- 0
wsgi_gunicorn.py View File

@@ -0,0 +1,6 @@
1
+#!/usr/bin/env python
2
+
3
+from rophako.app import app
4
+
5
+if __name__ == "__main__":
6
+    app.run(host='127.0.0.1')

Loading…
Cancel
Save