infra: dusting

This commit is contained in:
nemunaire 2018-12-06 03:48:53 +01:00
commit 8edc8e697c
5 changed files with 68 additions and 39 deletions

View file

@ -53,6 +53,9 @@ server {
location /rank {
rewrite ^/.*$ /index.html;
}
location /rules {
rewrite ^/.*$ /index.html;
}
location /tags/ {
rewrite ^/.*$ /index.html;
}
@ -78,11 +81,6 @@ server {
expires epoch;
add_header Cache-Control no-cache;
}
location /public.json {
root /srv/TEAMS/_public/;
expires epoch;
add_header Cache-Control no-cache;
}
location /stats.json {
root /srv/TEAMS/;
expires epoch;
@ -98,13 +96,14 @@ server {
expires epoch;
add_header Cache-Control no-cache;
#if (!-f $document_root/../started) {
# rewrite ^/ /wait.json;
#}
if (!-f $document_root/../started) {
rewrite ^/ /wait.json;
}
}
location /settings.json {
root /srv/TEAMS/;
root /srv/SETTINGS/;
expires epoch;
add_header X-FIC-time $msec;
add_header Cache-Control no-cache;
}
location /teams.json {
@ -126,9 +125,8 @@ server {
return 403;
}
proxy_pass http://localhost:8081/admin/api/;
proxy_pass http://fic-admin:8081/admin/api/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
@ -140,9 +138,8 @@ server {
return 403;
}
proxy_pass http://localhost:8081;
proxy_pass http://fic-admin:8081;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
@ -154,9 +151,8 @@ server {
rewrite ^/submit/(.*)$ /submission/$team/$1 break;
proxy_pass http://localhost:8080/;
proxy_pass http://fic-frontend:8080/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
@ -168,9 +164,21 @@ server {
rewrite ^/submit/.*$ /chname/$team break;
proxy_pass http://localhost:8080/;
proxy_pass http://fic-frontend:8080/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_redirect off;
}
location /registration {
#auth_basic "Secure Zone";
#auth_basic_user_file ficpasswd;
include /etc/nginx/auth.conf;
rewrite ^/registration /registration/$team break;
proxy_pass http://fic-frontend:8080;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
@ -182,9 +190,8 @@ server {
rewrite ^/openhint/(.*)$ /openhint/$team/$1 break;
proxy_pass http://localhost:8080/;
proxy_pass http://fic-frontend:8080/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
@ -196,19 +203,17 @@ server {
rewrite ^/wantchoices/(.*)$ /wantchoices/$team/$1 break;
proxy_pass http://localhost:8080/;
proxy_pass http://fic-frontend:8080/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
location = /events.json {
proxy_pass http://localhost:8081/api/events/;
proxy_pass http://fic-admin:8081/api/events/;
proxy_method GET;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
proxy_cache STATIC;
proxy_cache_valid 3s;

View file

@ -36,9 +36,6 @@ server {
location = /index.html {
include fic-auth.conf;
}
location ~ ^/public[0-9].html {
rewrite ^ /public.html;
}
location = /welcome.html {
internal;
if ($http_accept ~ "^application/json") {
@ -109,11 +106,6 @@ server {
expires epoch;
add_header Cache-Control no-cache;
}
location ~ /public[0-9].json {
root /srv/TEAMS/public/;
expires epoch;
add_header Cache-Control no-cache;
}
location /stats.json {
root /srv/TEAMS/;
expires epoch;
@ -170,6 +162,15 @@ server {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_redirect off;
}
location /registration {
include fic-auth.conf;
rewrite ^/registration /registration/$team break;
proxy_pass http://frontend:8080;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_redirect off;
}
location /openhint/ {
include fic-auth.conf;