forked from healthsites/healthsites
-
Notifications
You must be signed in to change notification settings - Fork 0
/
healthsites-nginx.conf
53 lines (44 loc) · 1.58 KB
/
healthsites-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
# Define connection details for connecting to django running in
# a docker container.
upstream django {
# for a file socket
#server unix:///tmp/uwsgi.sock;
# for a web port socket
server 127.0.0.1:49360;
}
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name healthsites.io;
charset utf-8;
access_log /var/log/nginx/healthsites.access.log main;
error_log /var/log/nginx/healthsites.error.log warn;
# max upload size, adjust to taste
client_max_body_size 15M;
# OTF gzip compression
gzip on;
gzip_min_length 860;
gzip_comp_level 5;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/xml application/x-javascript text/xml text/css application/json;
gzip_disable “MSIE [1-6].(?!.*SV1)”;
# Django media
location /media {
# your Django project's media files - amend as required
alias /home/USER/production-sites/healthsites/django_project/media;
expires 21d; # cache for 71 days
}
location /static {
# your Django project's static files - amend as required
alias /home/USER/production-sites/healthsites/django_project/static;
expires 21d; # cache for 21 days
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
# the uwsgi_params file you installed needs to be passed with each
# request.
include /home/USER/production-sites/healthsites/docker-prod/uwsgi_params;
}
}