-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.nginx_conf_local
66 lines (54 loc) · 1.75 KB
/
.nginx_conf_local
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
worker_processes 5;
worker_rlimit_nofile 8192;
events {
worker_connections 1024;
}
http {
# replace the following:
# $nginx_etc with /usr/local/etc/nginx for mac or /etc/nginx for linux
# set $project_name to the path to the project/app_name
# eg: /Users/Mati/mati/work/CodeStreak/CodeStreak;
include $nginx_etc/mime.types;
include $nginx_etc/proxy.conf;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
error_log /tmp/CodeStreak.nginx.log error;
log_format main
'$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
upstream django {
server unix:///tmp/CodeStreak.sock; # for a file socket
# server 127.0.0.1:8001; # for a web port socket
}
server {
root $project_name;
# the port your site will be served on
listen 8000;
# the domain name it will serve for
server_name 127.0.0.1 localhost;
charset utf-8;
#Max upload size
client_max_body_size 75M; # adjust to taste
location ~ ^/static/(.*)$ {
alias static_collected/$1;
expires 1d;
}
location ~ ^/media/(.*)$ {
alias media/$1;
expires 1d;
}
location ~ /favicon.ico {
alias static_collected/img/favicon.png;
expires 1d;
}
# Finally, send all non-media requests to the Django server.
location / {
# all proxy headers should have been set
uwsgi_pass django;
include $nginx_etc/uwsgi_params;
}
}
}