1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
server {
listen 8014;
server_name 192.168.214.185;

location /zju/ {
proxy_pass http://speedtest.zju.edu.cn/;
proxy_set_header Host speedtest.zju.edu.cn;
# CORS
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Encoding';
if ($request_method = 'OPTIONS') {
return 204;
}
}
}