<commit_before>location /api/ {
	rewrite ^/api/(.*)$ /api/ApiEntryPoint.php last;
}

# questions2answers.
location /preguntas/ {
	index index.php;
	autoindex off;
	rewrite ^(.*)//(.*)$ /$1/$2 redirect;
	if (!-e $request_filename) {
		rewrite ^/preguntas/(.+)$ /preguntas/?qa-rewrite=$1&$query_string last;
	}
}

# Backendv1 WebSockets endpoint.
# TODO(lhchavez): Remove once we migrate to backendv2.
location ^~ /api/contest/events/ {
	rewrite ^/api/contest/events/(.*) /$1 break;
	proxy_pass            <%= @frontend_proxy_websockets_v1_url %>;
	proxy_read_timeout    90;
	proxy_connect_timeout 90;
	proxy_redirect        off;
	proxy_set_header      Upgrade $http_upgrade;
	proxy_set_header      Connection "upgrade";
	proxy_set_header      Host $host;
	proxy_http_version 1.1;
}

# Backendv2 WebSockets endpoint.
location ^~ /events/ {
	rewrite ^/events/(.*) /$1 break;
	proxy_pass            <%= @frontend_proxy_websockets_url %>;
	proxy_read_timeout    90;
	proxy_connect_timeout 90;
	proxy_redirect        off;
	proxy_set_header      Upgrade $http_upgrade;
	proxy_set_header      Connection "upgrade";
	proxy_set_header      Host $host;
	proxy_http_version 1.1;
}

# Backendv2 grader web interface.
location /grader/ {
  try_files $uri $uri/ @grader;
}
location @grader {
	rewrite    ^/grader/(.*) /$1 break;
	proxy_pass <%= @frontend_proxy_grader_url %>;
}

rewrite ^/admin/user/([a-zA-Z0-9_-]+)/?$ /admin/user.php?username=$1 last;
rewrite ^/admin/support/?$ /admin/support.php last;
rewrite ^/arena/?$ /arena/index.php last;
rewrite ^/arena/admin/?$ /arena/adminpractice.php last;
rewrite ^/arena/problem/([a-zA-Z0-9_+-]+)/?$ /arena/problem.php?problem_alias=$1 last;
rewrite ^/arena/problem/([a-zA-Z0-9_+-]+)/print/?$ /arena/problemprint.php?problem_alias=$1 last;
rewrite ^/arena/([a-zA-Z0-9_+-]+)/practice/?$ /arena/practice.php?contest_alias=$1  last;
rewrite ^/arena/([a-zA-Z0-9_+-]+)/virtual/?$ /arena/virtual.php?contest_alias=$1  last;
rewrite ^/arena/([a-zA-Z0-9_+-]+)/print/?$ /arena/contestprint.php?alias=$1 last;
rewrite ^/arena/[a-zA-Z0-9_+-]+/admin/?$ /arena/admin.php last;
rewrite ^/arena/[a-zA-Z0-9_+-]+/scoreboard/[a-zA-Z0-9_+-]+/?$ /arena/scoreboard.php last;
rewrite ^/arena/([a-zA-Z0-9_+-]+)/?$ /arena/contest.php?contest_alias=$1 last;
rewrite ^/coderofthemonth/?$ /coderofthemonth.php last;
rewrite ^/contest/?$ /contests.php last;
rewrite ^/contest/mine/?$ /contestmine.php last;
rewrite ^/contest/new/?$ /contestnew.php last;
rewrite ^/contest/([a-zA-Z0-9_+-]+)/?$ /arena/$1/ permanent;
rewrite ^/contest/([a-zA-Z0-9_+-]+)/activity/?$ /contestactivity.php?contest=$1 last;
rewrite ^/contest/([a-zA-Z0-9_+-]+)/edit/?$ /contestedit.php?contest=$1 last;
rewrite ^/contest/([a-zA-Z0-9_+-]+)/stats/?$ /conteststats.php?contest=$1 last;
rewrite ^/course/?$ /courselist.php last;
rewrite ^/course/([a-zA-Z0-9_+-]+)/activity/?$ /courseactivity.php?course=$1 last;
rewrite ^/course/new/?$ /coursenew.php last;
rewrite ^/course/([a-zA-Z0-9_+-]+)/?$ /course.php?course_alias=$1 last;
rewrite ^/course/([a-zA-Z0-9_+-]+)/assignment/([a-zA-Z0-9_+-]+)/admin/?$ /arena/courseadmin.php?course_alias=$1&assignment_alias=$2 last;
rewrite ^/course/([a-zA-Z0-9_+-]+)/assignment/([a-zA-Z0-9_+-]+)/?$ /course.php?course_alias=$1&assignment_alias=$2 last;
rewrite ^/course/([a-zA-Z0-9_+-]+)/assignment/([a-zA-Z0-9_+-]+)/scoreboard/([a-zA-Z0-9_+-]+)/?$ /coursescoreboard.php?course_alias=$1&assignment_alias=$2 last;
rewrite ^/course/([a-zA-Z0-9_+-]+)/edit/?$ /courseedit.php?course=$1 last;
rewrite ^/course/([a-zA-Z0-9_+-]+)/list/?$ /coursesubmissionslist.php?course=$1 last;
rewrite ^/course/([a-zA-Z0-9_+-]+)/student/([a-zA-Z0-9_+-]+)/?$ /coursestudent.php?course=$1&student=$2 last;
rewrite ^/course/([a-zA-Z0-9_+-]+)/students/?$ /coursestudents.php?course=$1 last;
rewrite ^/group/?$ /grouplist.php last;
rewrite ^/group/new/?$ /groupnew.php last;
rewrite ^/group/([a-zA-Z0-9_+:-]+)/edit/?$ /groupedit.php?group=$1 last;
rewrite ^/group/([a-zA-Z0-9_+:-]+)/scoreboard/([a-zA-Z0-9_+-]+)/?$ /groupscoreboard.php?group=$1&scoreboard=$2 last;
rewrite ^/group/([a-zA-Z0-9_+:-]+)/scoreboard/([a-zA-Z0-9_+-]+)/edit/?$ /groupscoreboardedit.php?group=$1&scoreboard=$2 last;
rewrite ^/group/([a-zA-Z0-9_+:-]+)/stats/?$ /groupstats.php?group=$1 last;
rewrite ^/interview/list/?$ /interviews/list.php last;
rewrite ^/interview/([a-zA-Z0-9_+-]+)/arena?$ /interviews/arena.php?alias=$1 last;
rewrite ^/interview/([a-zA-Z0-9_+-]+)/edit?$ /interviews/edit.php?alias=$1 last;
rewrite ^/interview/([a-zA-Z0-9_+-]+)/result/([a-zA-Z0-9_+-.]+)?$ /interviews/results.php?contest_alias=$1&username=$2 last;
rewrite ^/login/?$ /login.php last;
rewrite ^/login/google/?$ /logingoogle.php last;
rewrite ^/login/password/recover/?$ /loginpasswordrecover.php last;
rewrite ^/login/password/reset/?$ /loginpasswordreset.php last;
rewrite ^/logout/?$ /logout.php last;
rewrite ^/nomination/?$ /qualitynomination.php last;
rewrite ^/nomination/([0-9]+)/?$ /qualitynomination.php?qualitynomination_id=$1 last;
rewrite ^/nomination/mine/?$ /qualitynomination_mine.php last;
rewrite ^/permissions/?$ /permissions.php last;
rewrite ^/problem/?$ /problemlist.php last;
rewrite ^/problem/list/?$ /problemlist.php last;
rewrite ^/problem/mine/?$ /problemmine.php last;
rewrite ^/problem/new/?$ /problemnew.php last;
rewrite ^/problem/([a-zA-Z0-9_+-]+)/edit/?$ /problemedit.php?problem=$1 last;
rewrite ^/problem/([a-zA-Z0-9_+-]+)/stats/?$ /problemstats.php?problem=$1 last;
rewrite ^/profile/?$ /profile.php last;
rewrite ^/profile/edit/?$ /profileedit.php last;
rewrite ^/profile/([a-zA-Z0-9_+.-]+)/?$ /profile.php?username=$1 last;
rewrite ^/rank/?$ /rank.php last;
rewrite ^/privacypolicy/?$ /privacypolicy.php last;
rewrite ^/schoolsrank/?$ /schoolsrank.php last;<commit_msg>Forwarding all forwardable rewrites to the frontend rewrites file<commit_after># MANAGED BY PUPPET

# Backendv2 WebSockets endpoint.
location ^~ /events/ {
	rewrite ^/events/(.*) /$1 break;
	proxy_pass            <%= @frontend_proxy_websockets_url %>;
	proxy_read_timeout    90;
	proxy_connect_timeout 90;
	proxy_redirect        off;
	proxy_set_header      Upgrade $http_upgrade;
	proxy_set_header      Connection "upgrade";
	proxy_set_header      Host $host;
	proxy_http_version 1.1;
}

# Backendv2 grader web interface.
location /grader/ {
  try_files $uri $uri/ @grader;
}
location @grader {
	rewrite    ^/grader/(.*) /$1 break;
	proxy_pass <%= @frontend_proxy_grader_url %>;
}

include <%= @root %>/frontend/server/nginx.rewrites;
{'fraction_non_alphanumeric': 0.21497919556171982, 'fraction_numerical': 0.024040684234858993, 'mean_word_length': 4.337171052631579, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1065092', 'n_tokens_mistral': 2824, 'n_tokens_neox': 2661, 'n_words': 412}