-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
41 lines (34 loc) · 1007 Bytes
/
nginx.conf
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
events {}
http {
include mime.types;
# fallback in case we can't determine a type
default_type application/octet-stream;
upstream django {
server web:8000 fail_timeout=0;
}
server {
# if no Host match, close the connection to prevent host spoofing
listen 80 default_server;
return 444;
}
server {
listen 80;
client_max_body_size 4G;
server_name localhost;
keepalive_timeout 5;
# static files directory
location /static {
sendfile on;
alias /www/data;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
# we don't want nginx trying to do something clever with
# redirects, we set the Host: header above already.
proxy_redirect off;
proxy_pass http://django;
}
}
}