-
Notifications
You must be signed in to change notification settings - Fork 0
/
OpenSpeedTest-Server-HTTP3.conf
95 lines (78 loc) · 4.29 KB
/
OpenSpeedTest-Server-HTTP3.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# ©CopyRight 2013-2022 by OpenSpeedTest.COM. All Rights Reserved.
# Official Website : https://OpenSpeedTest.COM | Email: [email protected]
# Developed by : Vishnu | https://Vishnu.Pro | Email : [email protected]
# HTML5 Network Performance Estimation Tool -> [JS,XHR,SVG,HTML,CSS]
# Started in 2011 and Moved to OpenSpeedTest.COM Dedicated Project/Domain Name in 2013.
# SpeedTest Script -> 2013 -> Beta | 2015 -> V1 | 2019 ->V2 | 2020 V2.1 | 2021 V2.12.
# Self-Hosted OpenSpeedTest-Server (iFrame/Nginx) -> 2014.
# OpenSpeedTest-Server (On-premises)
# [Docker] -> V1 2019 | V2 2020 | V2.1 2021
# [Node.js/Electron JS] -> 2020 V1 | 2021 V2 & V2.1
# Download -> https://go.openspeedtest.com/Server
# Like this Project? Please Donate NOW & Keep us Alive -> https://go.openspeedtest.com/Donate
# Share — copy and redistribute the material in any medium or format for any purpose, even commercially.
# Read full license terms @ http://go.openspeedtest.com/License
# If you have any Questions, ideas or Comments Please Send it via -> https://go.openspeedtest.com/SendMessage
server {
server_name _ localhost;
listen {HTTP_PORT};
listen {HTTPS_PORT} ssl http2;
listen {QUIC_PORT} quic;
http3_cc_algorithm {QUIC_CC};
# If you like to Ebable HTTP2 add "http2" to the above line.
# If HTTP2 Enabled Upload location should Proxy_Pass to http port.
# Otherwise you will see abnormal Upload Speeds.
# Nginx Server Windows SSL Performance was very poor! Better use Linux if you need SSL support.
ssl_certificate /etc/ssl/nginx.crt; # Use your own certificate & key
ssl_certificate_key /etc/ssl/nginx.key; # <-- key
ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
root /usr/share/nginx/html/;
index index.html;
client_max_body_size 10000M;
error_page 405 =200 $uri;
access_log off;
gzip off;
fastcgi_read_timeout 999;
log_not_found off;
server_tokens off;
error_log /dev/null; #Disable this for Windows Nginx.
tcp_nodelay on;
tcp_nopush on;
sendfile on;
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
expires epoch; # No-cache
add_header Cache-Control public;
location / {
add_header Alt-Svc 'h3-29=":{QUIC_PORT}"; ma=86400, h3=":{QUIC_PORT}"; ma=86400';
add_header 'Access-Control-Allow-Origin' "*" always;
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
#Very Very Important! You SHOULD send no-store from server for Google Chrome.
add_header Cache-Control 'no-store, no-cache, max-age=0, no-transform';
add_header Last-Modified $date_gmt;
if_modified_since off;
expires off;
etag off;
if ($request_method = OPTIONS ) {
add_header Access-Control-Allow-Credentials "true";
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With' always;
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
return 204;
}
# HTTP2 will return 200 withot waiting for upload to complete. it's smart but we don't need that to happen here when testing upload speed on HTTP2.
# Here we can forward it to a HTTP/1.1 upstream
location = /upload {
proxy_pass http://127.0.0.1:{HTTP_PORT}/dummy-upload;
}
}
location = /dummy-upload {
return 200;
}
}
# Make this Nginx conf. Better? Send me you ideas -> https://go.openspeedtest.com/SendMessage