├── .gitignore ├── OpenSpeedTest-Server.conf ├── README.md └── nginx.conf /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /OpenSpeedTest-Server.conf: -------------------------------------------------------------------------------- 1 | # SpeedTest by OpenSpeedTest™ is a Free and Open-Source Network Speed Test Software. 2 | # Like this Project? Please Donate NOW & Keep us Alive -> https://go.openspeedtest.com/Donate 3 | # Thank you for your support! we greatly appreciate your donation. 4 | # Your contribution helps us continue to improve and maintain the tool for everyone to use. 5 | # Official Website : https://OpenSpeedTest.com | Email: support@openspeedtest.com 6 | # Developed by : Vishnu | https://Vishnu.Pro | Email : me@vishnu.pro 7 | 8 | server { 9 | server_name _ localhost YOURDOMAIN; 10 | listen 3000 reuseport; 11 | listen 3001 ssl reuseport; 12 | listen [::]:3000 reuseport; 13 | listen [::]:3001 ssl reuseport; 14 | # If you like to Enable HTTP2 add "http2" to the above line. 15 | # If HTTP2 Enabled. Upload location should Proxy_Pass to http 1.1 port. 16 | # Otherwise you will see abnormal Upload Speeds. 17 | # Nginx Server Windows SSL Performance was very poor! Better use Linux if you need SSL support. 18 | ssl_certificate /etc/ssl/nginx.crt; # Use your own certificate & key 19 | ssl_certificate_key /etc/ssl/nginx.key; # <-- key 20 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; 21 | ssl_ciphers "ALL"; 22 | ssl_prefer_server_ciphers on; 23 | ssl_session_cache shared:SSL:100m; 24 | ssl_session_timeout 1d; 25 | ssl_session_tickets on; 26 | root /usr/share/nginx/html/; 27 | index index.html; 28 | client_max_body_size 35m; 29 | error_page 405 =200 $uri; 30 | access_log off; 31 | gzip off; 32 | fastcgi_read_timeout 999; 33 | log_not_found off; 34 | server_tokens off; 35 | error_log /dev/null; #Disable this for Windows Nginx. 36 | tcp_nodelay on; 37 | tcp_nopush on; 38 | sendfile on; 39 | open_file_cache max=200000 inactive=20s; 40 | open_file_cache_valid 30s; 41 | open_file_cache_min_uses 2; 42 | open_file_cache_errors off; 43 | 44 | location ~ /\.well-known/acme-challenge/ { 45 | allow all; 46 | default_type "text/plain"; 47 | root /usr/share/nginx/html/; 48 | try_files $uri =404; 49 | break; 50 | } 51 | 52 | location / { 53 | add_header 'Access-Control-Allow-Origin' "*" always; 54 | 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; 55 | add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; 56 | #Very Very Important! You SHOULD send no-store from server for Google Chrome. 57 | add_header Cache-Control 'no-store, no-cache, max-age=0, no-transform'; 58 | add_header Last-Modified $date_gmt; 59 | if_modified_since off; 60 | expires off; 61 | etag off; 62 | 63 | if ($request_method = OPTIONS ) { 64 | add_header 'Access-Control-Allow-Credentials' "true"; 65 | 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; 66 | add_header 'Access-Control-Allow-Origin' "$http_origin" always; 67 | add_header 'Access-Control-Allow-Methods' "GET, POST, OPTIONS" always; 68 | return 200; 69 | } 70 | } 71 | 72 | #HTTP2 & HTTP3 will not wait for the post body and return 200. We need to stop that behaviour. 73 | #Otherwise, you will see abnormal upload speed. To fix this issue, Enable the following lines. (Only Applicable If you Enabled HTTP2 or HTTP3 in This Server.) 74 | 75 | #HTTP2 & HTTP3 -> UPLOAD FIX -- START 76 | 77 | #location = /upload { 78 | # proxy_pass http://127.0.0.1:3000/dev-null; 79 | #} 80 | #location = /dev-null { 81 | # return 200; 82 | #} 83 | 84 | #HTTP2 & HTTP3 -> UPLOAD FIX -- END 85 | 86 | # Caching for Static Files, 87 | location ~* ^.+\.(?:css|cur|js|jpe?g|gif|htc|ico|png|html|xml|otf|ttf|eot|woff|woff2|svg)$ { 88 | access_log off; 89 | expires 365d; 90 | add_header Cache-Control public; 91 | add_header Vary Accept-Encoding; 92 | tcp_nodelay off; 93 | open_file_cache max=3000 inactive=120s; 94 | open_file_cache_valid 45s; 95 | open_file_cache_min_uses 2; 96 | open_file_cache_errors off; 97 | gzip on; 98 | gzip_disable "msie6"; 99 | gzip_vary on; 100 | gzip_proxied any; 101 | gzip_comp_level 6; 102 | gzip_buffers 16 8k; 103 | gzip_http_version 1.1; 104 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **[SpeedTest by OpenSpeedTest™](https://openspeedtest.com?Run&ref=Github)** - Free & Open-Source HTML5 Network Performance Estimation Tool. 2 | ## **[Nginx-Configuration for OpenSpeedTest-Server](https://openspeedtest.com/selfhosted-speedtest?ref=Github)** 3 | 4 | [![SpeedTest by OpenSpeedTest™](https://github.com/openspeedtest/v2-Test/raw/main/images/10G-S.gif)](https://hub.docker.com/r/openspeedtest/latest "SpeedTest by OpenSpeedTest™") 5 | **No client-side software or plugin is required. You can run a network speed test from any device with a [Web Browser that is IE10 or new.](https://www.youtube.com/watch?v=9f-OM_WQ7Bw&list=PLt-deStxFJOMEAs2O1lJhscMNzcg9E3Po&index=1)** 6 | -------------------------------------------------------------------------------- /nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes auto; 2 | worker_rlimit_nofile 100000; 3 | events { 4 | worker_connections 2048; 5 | multi_accept on; 6 | } 7 | 8 | error_log /var/log/nginx/error.log notice; 9 | pid /tmp/nginx.pid; 10 | 11 | http { 12 | include mime.types; 13 | default_type application/octet-stream; 14 | include /etc/nginx/conf.d/*.conf; 15 | 16 | 17 | } --------------------------------------------------------------------------------