Skip to content

Commit

Permalink
Add nginx conf
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdijk committed Sep 12, 2024
1 parent 935be79 commit 8dc2751
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -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 '<a class="btn btn-info btn-sm justify-content-center" href="/login">\n' '';
sub_filter '<i class="fas fa-sign-in-alt"></i> Login\n' '';
sub_filter_once off;

set $args $args&static=yes;

proxy_cache_valid any 1m;
proxy_pass ${DOMJUDGE_URL};
}
}

0 comments on commit 8dc2751

Please sign in to comment.