-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
47 lines (38 loc) · 1.25 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
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# the upstream component nginx needs to connect to websocket requests
upstream websocket {
server unix:/home/ubuntu/channels_sample/daphne.sock;
}
# the upstream component nginx needs to connect to http requests
upstream django {
server unix:///home/ubuntu/channels_sample/channels_sample.sock;
}
# configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name <your_ip_address__or__dns_name>;
charset utf-8;
# max upload size
client_max_body_size 75M;
# Django media
location /static {
alias /home/ubuntu/channels_sample/static1;
}
# Sending all non-media requests for websockets to the Daphne server.
location /ws/ {
proxy_pass http://websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Sending all non-media requests for http to the Uwsgi server.
location / {
uwsgi_pass django;
include /etc/nginx/uwsgi_params;
}
}