diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..a87ac0f --- /dev/null +++ b/nginx.conf @@ -0,0 +1,50 @@ +proxy_cache_path /data/nginx/cache keys_zone=mycache:10m; +server { + listen 8080; + listen [::]:8080; + + server_name localhost; + + proxy_cache mycache; + + location /login { + return 404; + } + + location /register { + return 404; + } + + location /jury { + return 404; + } + + location /team { + return 404; + } + + location /images { + proxy_cache_valid any 10m; + proxy_pass ${DOMJUDGE_URL}/images; + } + + location /flags { + proxy_cache_valid any 10m; + proxy_pass ${DOMJUDGE_URL}/flags; + } + + location / { + rewrite ^/$ /public redirect; + + proxy_set_header Accept-Encoding ""; + + sub_filter '\n' ''; + sub_filter ' Login\n' ''; + sub_filter_once off; + + set $args $args&static=yes; + + proxy_cache_valid any 1m; + proxy_pass ${DOMJUDGE_URL}; + } +}