-
Notifications
You must be signed in to change notification settings - Fork 11
/
nginxconf
42 lines (34 loc) · 1.11 KB
/
nginxconf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
upstream hello_app_server {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
#NEWER FORGET TO CHANGE SERVER_NAME WITH YOUR IP ADDRESS.
server unix:/opt/venv/run/gunicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name 167.99.47.107;
client_max_body_size 4G;
access_log /opt/venv/logs/nginx-access.log;
error_log /opt/venv/logs/nginx-error.log;
location /static/ {
alias /opt/venv/cloudbank/cloudbank/templates/static/;
}
location /media/ {
alias /opt/venv/cloudbank/cloudbank/templates/media/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://hello_app_server;
break;
}
}
# Error pages
error_page 500 502 503 504 /500.html;
location = /500.html {
root /opt/venv/cloudbank/cloudbank/templates/static/;
}
}