Skip to content

Commit fc86f9f

Browse files
Added reuseport
1 parent 1e8bd0a commit fc86f9f

File tree

1 file changed

+106
-108
lines changed

1 file changed

+106
-108
lines changed

files/OpenSpeedTest-Server.conf

+106-108
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,106 @@
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: [email protected]
6-
# Developed by : Vishnu | https://Vishnu.Pro | Email : [email protected]
7-
8-
server {
9-
server_name _ localhost YOURDOMAIN;
10-
listen 3000;
11-
listen 3001 ssl;
12-
listen [::]:3000;
13-
listen [::]:3001 ssl;
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-
54-
add_header 'Access-Control-Allow-Origin' "*" always;
55-
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;
56-
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
57-
#Very Very Important! You SHOULD send no-store from server for Google Chrome.
58-
add_header Cache-Control 'no-store, no-cache, max-age=0, no-transform';
59-
add_header Last-Modified $date_gmt;
60-
if_modified_since off;
61-
expires off;
62-
etag off;
63-
64-
if ($request_method = OPTIONS ) {
65-
add_header Access-Control-Allow-Credentials "true";
66-
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;
67-
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
68-
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
69-
return 200;
70-
}
71-
}
72-
73-
#HTTP2 & HTTP3 will not wait for the post body and return 200. We need to stop that behaviour.
74-
#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.)
75-
76-
#HTTP2 & HTTP3 -> UPLOAD FIX -- START
77-
78-
#location = /upload {
79-
#proxy_pass http://127.0.0.1:3000/dev-null;
80-
#}
81-
#location = /dev-null {
82-
#return 200;
83-
#}
84-
85-
#HTTP2 & HTTP3 -> UPLOAD FIX -- END
86-
87-
#Caching for Static Files,
88-
location ~* ^.+\.(?:css|cur|js|jpe?g|gif|htc|ico|png|html|xml|otf|ttf|eot|woff|woff2|svg)$ {
89-
access_log off;
90-
expires 365d;
91-
add_header Cache-Control public;
92-
add_header Vary Accept-Encoding;
93-
tcp_nodelay off;
94-
open_file_cache max=3000 inactive=120s;
95-
open_file_cache_valid 45s;
96-
open_file_cache_min_uses 2;
97-
open_file_cache_errors off;
98-
gzip on;
99-
gzip_disable "msie6";
100-
gzip_vary on;
101-
gzip_proxied any;
102-
gzip_comp_level 6;
103-
gzip_buffers 16 8k;
104-
gzip_http_version 1.1;
105-
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;
106-
}
107-
108-
}
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: [email protected]
6+
# Developed by : Vishnu | https://Vishnu.Pro | Email : [email protected]
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+
}

0 commit comments

Comments
 (0)