git.fiddlerwoaroof.com
Browse code

Added nginx server configuration to repo

fiddlerwoaroof authored on 15/03/2015 23:34:29
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,32 @@
1
+server {
2
+  listen 80;
3
+  listen [::]:80;
4
+  server_name marrow.example.org; ### Change this name to your dns name
5
+  access_log /var/log/nginx/marrow.access.log;
6
+  error_log /var/log/nginx/marrow.error.log;
7
+
8
+  root /path/to/marrow/static;
9
+  index index.html;
10
+
11
+
12
+  location / {
13
+    # pass unrecognized urls for index.html
14
+    # angularJS will handle the routing of most of these
15
+    try_files $uri /index.html;
16
+  }
17
+
18
+  # pass API requests to the python app
19
+  location = /api { rewrite ^ /api/; }
20
+  location /api { try_files $uri @api; }
21
+  location @api {
22
+    # You should run uwsgi like this: uwsgi -H `pwd` -s /tmp/uwsgi.sock --module src.main --callable app
23
+    # that command should be run from the root of the repository
24
+    # note that you might have to change the permissions of /tmp/uwsgi.sock to allow connections
25
+    include uwsgi_params;
26
+    uwsgi_param SCRIPT_NAME /api;
27
+    uwsgi_modifier1 30;
28
+    uwsgi_pass unix:/tmp/uwsgi.sock;
29
+  }
30
+
31
+}
32
+