nginx.conf
1.24 KB
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
server {
listen 80;
charset utf-8;
server_name URL-PROJECT-NAME;
return 301 https://$host$request_uri;
}
server {
listen 443;
charset utf-8;
server_name URL-PROJECT-NAME;
client_max_body_size 4G;
ssl on;
ssl_certificate /etc/letsencrypt/live/URL-PROJECT-NAME/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/URL-PROJECT-NAME/privkey.pem;
location /static/ {
# autoindex off;
alias /PATH/PROJECT/PROJECT-NAME/static/;
}
location /media/ {
# autoindex off;
alias /PATH/PROJECT/PROJECT-NAME/media/;
}
location / {
proxy_pass http://localhost:8000;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}
## Logs
access_log /PATH/PROJECT/deployment/logs/nginx-access.log;
error_log /PATH/PROJECT/deployment/logs/nginx-errors.log;
}