forked from openspeedtest/Speed-Test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
66 lines (56 loc) · 2.14 KB
/
nginx.conf
File metadata and controls
66 lines (56 loc) · 2.14 KB
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
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /tmp/nginx.pid;
events {
worker_connections 2048;
multi_accept on;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nodelay on;
tcp_nopush on;
server_tokens off;
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
server {
listen 3000;
root /usr/share/nginx/html;
index index.html;
client_max_body_size 35m;
lingering_time 300s;
lingering_timeout 60s;
error_page 405 =200 $uri;
access_log off;
log_not_found off;
gzip off;
location / {
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;
add_header Cache-Control 'no-store, no-cache, max-age=0, no-transform';
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 200;
}
}
location /assets/ {
expires 365d;
add_header Cache-Control public;
add_header Vary Accept-Encoding;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
}
}
}