2015-12-23 06:26:27 +00:00
|
|
|
server {
|
|
|
|
listen 80 default_server;
|
|
|
|
listen [::]:80 default_server ipv6only=on;
|
2015-12-24 05:29:04 +00:00
|
|
|
sendfile off;
|
2015-12-23 06:26:27 +00:00
|
|
|
|
|
|
|
root /srv/http/ctf;
|
|
|
|
index index.html index.htm;
|
|
|
|
|
|
|
|
server_name localhost;
|
2016-01-12 03:54:26 +00:00
|
|
|
error_page 404 /404;
|
2015-12-23 06:26:27 +00:00
|
|
|
|
2015-12-25 03:38:00 +00:00
|
|
|
# location / {
|
|
|
|
# try_files $uri $uri/ =404;
|
|
|
|
# }
|
2015-12-26 05:48:20 +00:00
|
|
|
|
|
|
|
# Put all the pages here so Angular doesn't fail.
|
2016-01-06 06:15:57 +00:00
|
|
|
location ~^/(about|chat|help|learn|login|profile|register|scoreboard|settings|team)$ {
|
2015-12-25 03:38:00 +00:00
|
|
|
default_type text/html;
|
|
|
|
try_files /index.html /index.html;
|
2015-12-23 06:26:27 +00:00
|
|
|
}
|
2016-01-07 00:23:43 +00:00
|
|
|
location ~^/admin/(problems)$ {
|
|
|
|
default_type text/html;
|
|
|
|
try_files /index.html /index.html;
|
|
|
|
}
|
2016-01-12 03:54:26 +00:00
|
|
|
location ~^/(profile|team)/(.*)$ {
|
2016-01-07 06:23:00 +00:00
|
|
|
default_type text/html;
|
|
|
|
try_files /index.html /index.html;
|
|
|
|
}
|
2015-12-23 19:49:31 +00:00
|
|
|
|
|
|
|
location ~ /api {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_pass http://localhost:8000;
|
|
|
|
proxy_redirect off;
|
|
|
|
}
|
2016-01-07 06:23:00 +00:00
|
|
|
}
|