forked from membermatters/MemberMatters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
67 lines (54 loc) · 1.78 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
worker_processes 2;
user nobody nogroup;
# 'user nobody nobody;' for systems with 'nobody' as a group instead
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024; # increase if you have lots of clients
accept_mutex on; # set to 'on' if nginx worker_processes > 1
# 'use epoll;' to enable for Linux 2.6+
}
http {
include mime.types;
# fallback in case we can't determine a type
default_type application/octet-stream;
access_log /var/log/nginx/access.log combined;
sendfile on;
upstream app_server {
# for UNIX domain socket setups
server unix:/tmp/gunicorn.sock fail_timeout=10s;
# for a TCP configuration
# server 192.168.0.7:8000 fail_timeout=0;
}
server {
listen 8000 deferred default_server;
client_max_body_size 10M;
# set the correct host(s) for your site
server_name _;
keepalive_timeout 5;
# path for static files
root /usr/src/app/memberportal/portal/static;
location /static/ {
alias /usr/src/app/memberportal/portal/static/;
expires 7d;
add_header Cache-Control "public";
}
location /media/ {
alias /usr/src/data/media/;
expires 14d;
add_header Cache-Control "public";
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $http_x_real_ip;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
# 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://app_server;
}
}
}