-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
60 lines (44 loc) · 1.36 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
proxy_cache_path /var/nginx/cache keys_zone=default_cache:10m max_size=2g;
server {
listen 8080;
listen [::]:8080;
port_in_redirect off;
server_name localhost;
proxy_cache default_cache;
proxy_cache_key $scheme$proxy_host$uri$is_args$args$http_x_requested_with;
proxy_buffering on;
proxy_ignore_headers Expires;
proxy_ignore_headers X-Accel-Expires;
proxy_ignore_headers Cache-Control;
proxy_ignore_headers Set-Cookie;
proxy_hide_header X-Accel-Expires;
proxy_hide_header Expires;
proxy_hide_header Cache-Control;
proxy_hide_header Pragma;
add_header X-Proxy-Cache $upstream_cache_status;
rewrite ^/(.*)/$ /$1 permanent;
location = /health {
access_log off;
add_header 'Content-Type' 'application/json';
return 200 '{"status":"UP"}';
}
location = / {
return 302 /public;
}
location ~ ^/(login|register|jury|team) {
return 404;
}
location ~ ^\/public\/.+ {
return 404;
}
location ~ ^/((images|flags|css|js|style_domjudge.css|webfonts|favicon.ico).*) {
proxy_cache_valid any 10m;
proxy_pass ${DOMJUDGE_URL}/$1;
}
location / {
set $args static=1&contest=auto;
proxy_set_header Accept-Encoding "";
proxy_cache_valid any 1m;
proxy_pass ${DOMJUDGE_URL};
}
}