-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstatusconsole.nginx
56 lines (47 loc) · 1.35 KB
/
statusconsole.nginx
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
54
55
56
upstream up_server {
server unix:/var/www/sockets/gunicorn.sock fail_timeout=10s;
}
# This is not neccessary - it's just commonly used
# it just redirects example.com -> www.example.com
# so it isn't treated as two separate websites
#server {
# listen 80;
# server_name example.com;
# return 301 $scheme://www.example.com$request_uri;
#}
server {
listen 80 default_server;
client_max_body_size 4G;
access_log /var/log/nginx/nginx-access.log;
error_log /var/log/nginx/nginx-error.log warn;
location /static/ {
autoindex on;
alias /var/www/statusConsole/static/;
}
location /media/ {
autoindex on;
alias /var/www/statusConsole/static/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://up_server;
break;
}
}
#For favicon
location /favicon.ico {
alias /var/www/statusConsole/static/img/favicon.ico;
}
#For robots.txt
location /robots.txt {
alias /var/www/statusConsole/static/robots.txt ;
}
# Error pages
error_page 500 502 503 504 /500.html;
location = /500.html {
root /var/www/statusConsole/static/;
}
}