-
Notifications
You must be signed in to change notification settings - Fork 3
/
nginx-sxconsole-lite.conf
47 lines (37 loc) · 1.07 KB
/
nginx-sxconsole-lite.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
upstream app_server_djangoapp {
server localhost:8000 fail_timeout=0;
}
server {
listen 443;
server_name sxconsole-lite;
ssl on;
ssl_certificate /etc/nginx/ssl/sxconsole-lite.crt;
ssl_certificate_key /etc/nginx/ssl/sxconsole-lite.key;
access_log /srv/logs/nginx-access.log;
error_log /srv/logs/nginx-error.log info;
keepalive_timeout 5;
root /var/www/nonexistent;
location /static {
autoindex off;
alias /srv/sxconsole-lite/static;
}
location /media {
autoindex off;
alias /srv/sxconsole-lite/media;
}
error_page 500 502 503 504 /custom_50x.html;
location = /custom_50x.html {
root /var/www/error_pages;
internal;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Protocol https;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://app_server_djangoapp;
break;
}
}
}