-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.conf.template
52 lines (42 loc) · 1.58 KB
/
default.conf.template
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
# the upstream component nginx needs to connect to
upstream django {
server unix:///code/base.sock; # UNIX file socket
# Defaulting to macOS equivalent of docker0 network for TCP socket
#server host.docker.internal:8000; # TCP socket
}
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl default_server;
# the domain name it will serve for
server_name $host:8443; # substitute your machine's IP address or FQDN and port
# If they come here using HTTP, bounce them to the correct scheme
error_page 497 https://$server_name$request_uri;
# Or if you're on the default port 443, then this should work too
# error_page 497 https://;
# Let's Encrypt format (ref: )
ssl_certificate /etc/ssl/fullchain.pem;
ssl_certificate_key /etc/ssl/privkey.pem;
ssl_trusted_certificate /etc/ssl/chain.pem;
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /media {
alias /code/media; # your Django project's media files - amend as required
}
location /static {
alias /code/static; # your Django project's static files - amend as required
}
# Finally, send all non-media requests to the Django server.
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
uwsgi_pass django;
include /code/uwsgi_params; # the uwsgi_params file
}
}