-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbg-upgrades.nginx.conf
44 lines (35 loc) · 1.28 KB
/
bg-upgrades.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
# the upstream component nginx needs to connect to
upstream django {
server unix:///path/to/project/mysite.sock; # for a file socket
# server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
# configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name bg-upgrad.es; # substitute your machine's IP address or FQDN
charset utf-8;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/bg-upgrades.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/bg-upgrades.net/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
# Redirect non-https traffic to https
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
# max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /result {
alias /path/to/project/tmp; # your Django project's media files - amend as required
}
location /static {
alias /path/to/project/staticfiles;
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
include /usr/local/etc/nginx/uwsgi_params; # the uwsgi_params file you installed
}
}